• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Creating a shortcut with a batch file

aujames

Member
I working on a application I need to install to a user's desktop (in XP or 2000). I created a self-extracting executable that extracts the necessary files and then runs the following batch file to copy a shortcut (created previously) to the desktop for all users:

@echo off
copy "Application.lnk" "%allusersprofile%\Desktop\Application.lnk" /y

My only issue appears to be if that user does not have Admin rights to that PC. If the user doesn't have the admin rights, the shortcut will not copy succesfully.

What I would like to do is either copy the icon to the current user's desktop only, or overcome the issue with having to have admin rights.

Any suggestions would be much apprciated.

Thanks!
JD
 
Well you can't overcome the admin rights problem unless you grant the user admin rights, or you execute the executable as an admin user using "Run As".

Copying the shortcut to the users desktop is easy:

copy "Application.lnk" "%userprofile%\Desktop\Application.lnk" /y
 
Back
Top