My objective is to copy a shortcut (.lnk) from a network share to the users windows startup folder. The issue is we support variuos flavors of windows (XP, Vista, 7) so the users statup folder is a moving target. I'm by no means a seasoned programer, but I've hobbled (with major help from the internet) together a batch file that almost works. My problem is I can't get the "reg query" to return the full path to the startup folder. It is truncating the path.
Can anyone take a look at what I have and make a suggestion?
Thanks for any help
for /f "tokens=3" %%a in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Startup ^| find /i "REG_SZ"') do set startup=%%a
copy "T:\Applications\Shortcuts\Chklogin.lnk" %startup%
Can anyone take a look at what I have and make a suggestion?
Thanks for any help
for /f "tokens=3" %%a in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Startup ^| find /i "REG_SZ"') do set startup=%%a
copy "T:\Applications\Shortcuts\Chklogin.lnk" %startup%