PC Review


Reply
Thread Tools Rate Thread

Create Shortcuts From Command-Line

 
 
Joe Caverly
Guest
Posts: n/a
 
      19th Apr 2005
Hi,
CmdUtils from http://www.maddogsw.com/cmdutils has a command-line
utility called ContextMenu, "which displays the shell context menu for
the specified file(s); from here, with one more step, you can get
Properties, Quick View, or any other supported action for the
specified file(s)", including the ability to create a shortcut.

Other utilities include Recycle, PropsFor, Bin, FixP, and the full
source code for all of these utilities.

Joe
 
Reply With Quote
 
 
 
 
Laurent Herve
Guest
Posts: n/a
 
      19th Apr 2005

"Joe Caverly" <(E-Mail Removed)> a écrit dans le message de news:
(E-Mail Removed)...
> Hi,
> CmdUtils from http://www.maddogsw.com/cmdutils has a command-line
> utility called ContextMenu, "which displays the shell context menu for
> the specified file(s); from here, with one more step, you can get
> Properties, Quick View, or any other supported action for the
> specified file(s)", including the ability to create a shortcut.
>
> Other utilities include Recycle, PropsFor, Bin, FixP, and the full
> source code for all of these utilities.
>
> Joe


Nice idea since it is impossible to created shortcuts from commun DOS
prompt,
-and i just see that the shortcuts have the same name as the original the
file ! that
is very nice, i have posted on msdos.batch few months agoo, there was no
solution !
Thanks a lot,

laurent


 
Reply With Quote
 
Toad
Guest
Posts: n/a
 
      20th Apr 2005
Laurent Herve wrote:

>
> "Joe Caverly" <(E-Mail Removed)> a icrit dans le message de news:
> (E-Mail Removed)...
> > Hi,
> > CmdUtils from http://www.maddogsw.com/cmdutils has a command-line
> > utility called ContextMenu, "which displays the shell context menu
> > for the specified file(s); from here, with one more step, you can
> > get Properties, Quick View, or any other supported action for the
> > specified file(s)", including the ability to create a shortcut.
> >
> > Other utilities include Recycle, PropsFor, Bin, FixP, and the full
> > source code for all of these utilities.
> >
> > Joe

>
> Nice idea since it is impossible to created shortcuts from commun DOS
> prompt,
> -and i just see that the shortcuts have the same name as the original
> the file ! that
> is very nice, i have posted on msdos.batch few months agoo, there was
> no solution !
> Thanks a lot,
>
> laurent


Not impossible at all. Windows comes with something called WSH (Windows
Scriptng Host) which allows for scripting lots of things. One thing
that can be scripted is the creation of shortcuts. A script can be run
from the command line.

Here is an example taken right from the WSH doc using Java Script (VB
Script works too):

DesktopPath = Shell.SpecialFolders("Desktop");
link = Shell.CreateShortcut(DesktopPath + "\\test.lnk");
link.Arguments = "1 2 3";
link.Description = "test shortcut";
link.HotKey = "CTRL+ALT+SHIFT+X";
link.IconLocation = "foo.exe,1";
link.TargetPath = "c:\\blah\\foo.exe";
link.WindowStyle = 3;
link.WorkingDirectory = "c:\\blah";
link.Save();

Save this in a .JS file on disk and simple run it from the command
line, changing the various paths to be what you want.

WSH makes batch files pretty useless except for launching scripts.

Also, I recommend running cscript.exe //H:cscript from the command line
to set the default scripting engine to the command line version.

Toad

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you use command line in shortcuts now ? =?Utf-8?B?c3RldmUgaC4=?= Windows Vista General Discussion 8 29th Jun 2006 06:25 PM
Command Line For Shortcuts To Minimize??? =?Utf-8?B?QnJhbmRvbiBLcmFtZXI=?= Windows XP General 1 15th Dec 2005 08:56 PM
Command-line utility to create shortcuts ? Antoine Freeware 4 19th Apr 2005 03:30 AM
Command-line utility to create shortcuts ? Antoine Freeware 2 18th Apr 2005 05:11 PM
INF and Shortcuts command line switch Craig Microsoft Dot NET Compact Framework 5 19th Nov 2004 02:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:25 PM.