Create Shortcut on desktop by batch file

August 12, 2009 at 15:57:33
Specs: Windows XP, 1 GB

Hi,

I am looking for batch code which can create shortcut on desktop for batch file like c:/batch/Process1.bat

So that when any user run this code it will create shortcut on his desktop.


See More: Create Shortcut on desktop by batch file

Report •


#1
August 12, 2009 at 16:30:36

First you make the PIF file which is a short-cut. Just use the shortcut wizard. Then in you batch file copy the PIF into the all users\desktop like...

copy \\myserver\myshortcuts\myshortcut.pif %AllUsersProfile%\desktop

You must have administrator rights to run this command so it might not work in a login script. I have yet to figure out how to do this without either MSI file or script the has an administrator login password coded in it. I just had my programmer make a special runas for me.


Report •

#2
August 12, 2009 at 20:36:11


Another way:

If you dont bother in using a third party app in this job, you can download shortcut.exe (www.optimumx.com) and call it in a bat.

shortcut.exe /f:"%AllUsersProfile%\desktop\ShortcutName.pif" /a:c /t:folder:\MyApp ... i/image.icon.....

( check the syntax)


Report •

#3
August 13, 2009 at 09:12:01

Hi,

I am thinking too much may be but is this possible to create shortcut links for batch files in
All Programs-->Batch Prog-->Batch files options in programs sections where all applications have shortcut to main file.


Report •

Related Solutions

#4
August 13, 2009 at 10:15:22

(All programs --> batch prog --> batch files)

You must to create a folder, f.ex. "Batch Programming". Copy to this folder all shortcuts you want. Copy this folder to c:\documents and settings\All users\start menu\programs.

The new path will immediately appear in start menu/all programs, like this:

all programas--> batch programming --> bat1
. . . . . . . . . . . . . . . . . . . . . . . . . . --> bat2
. . . . . . . . . . . . . . . . . . . . . . . . . . . --> bat3
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . etc..



Report •

#5
August 13, 2009 at 10:41:47

Hi,

I have created shortcuts .lnk files and copy all those files to
Batch_Prog Folder
C:\Batch>copy *.lnk Batch_prog
Generate and Transfer to iSeries.lnk
Generate files for Transfer.lnk
Transfer files to iSeries.lnk
3 file(s) copied.

But if I try to transfer this folder to start programs like


C:\>copy c:\Batch\Batch_Prog C:\Documents and Settings\All Users\Start Menu\Programs
The syntax of the command is incorrect.


C:\>xcopy c:\Batch\Batch_Prog C:\Documents and Settings\All Users\Start Menu\Pr
ograms
Invalid number of parameters


Where am I going wrong?


Report •

#6
August 13, 2009 at 10:57:59

Ohh. I found the solutions.

C:\>move c:\Batch\Batch_Prog "\Documents and Settings\All Users\Start Menu\Pro
ams"

Just double quote the folders which have space in name


Report •


Ask Question