Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Install ICONS from batch file 1

Status
Not open for further replies.

golf212

Programmer
Aug 24, 2005
24
US
I am trying to create a “simple” batch install program to create a sub-dir on the users hard-drive, copy files, and place a shortcut on the desktop. My problem is placing a shortcut on a Vista desktop. I have a statement that works for XP just fine:

COPY mylink.lnk C:\”Documents and Settings”\”All Users”\Desktop

I have not been able to find and equivalent for Vista installs. I did a 'Google' but really did not find anything related to actually programmatically installing icons.

Thanks in Advance
John
 
In Vista the Documents and Settings is now the Users folder.
 
The address might be just Desktop, when I type that in the Start Run, or Explorer Address Bar, it will take me to the currently logged on user's Desktop.
 
You can also use the environment variable %ALLUSERSPROFILE%, this way your batch file should work in either XP or Vista.
 
Thanks for replies and I appoligize for the slow response. Vanka25: I tried to incorporate the %ALLUSERSPROFILE% in the batch file but was unable to figure out the syntax. If you have any thoughts on that you could share, it would be greatly appreciated.

Thanks
 
For vista the 'all users desktop' is in different location:

%public%\desktop (and %public% is typically C:\Users\Public)

So,
Code:
COPY mylink.lnk  %public%\desktop
This will require UAC elevation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top