Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: shortcutdir shortcut LNK filecopy
During login, debug always reports fileexist() as 0, (whether or not the file actually exists) and filecopy() as 1, (but never successfully copies the file. PS, all variables seem to be initialized properly in both cases. What's up Doc?
username=environment("username") STARTUP="C:\WINDOWS\Profiles\%USERNAME%\Start Menu\Programs\StartUp" popup=fileexist("STARTUP\winpopup.lnk") if popup == 0 dirchange("k:\") filecopy ("winpopup.lnk", STARTUP, @false) else endif
popup=fileexist("%STARTUP%\winpopup.lnk")In addition, do a FileExist on lnk files "shortcut" -- this function looks thru the lnk file and tests the existence of the target file (rather than just looking for the LNK file itself). Is that what you wanted?
See revised script below:
DEBUG(1) username=environment("username") STARTUP="C:\WINDOWS\Profiles\%USERNAME%\StartMenu\Programs\StartUp" ;OR MAYBE TRY INSTEAD STARTUP=ShortcutDir("StartUp") popup=fileexist("%STARTUP%\winpopup.lnk") if popup == 0 ShortCutMake(...see docs...) endif
Article ID: W13507
Filename: Get Username and Copy Shortcut in Login Script.txt
File Created: 1999:04:15:16:54:30
Last Updated: 1999:04:15:16:54:30