Windows desktop shortcut question
-
I want to create a GUI shortcut to launch and executable that is in a nested directory. Specifically I need this shortcut to NOT need to know it's own directory name, i.e. I cannot supply the full path. The executable is in: C:\appdir-YYYYMMDD\debug\app.exe The shortcut is in directory: C:\appdir-YYYYMMDD The YYYYMMDD changes but I would like the shortcut to always run the executable that is nested below it. If I create a Shortcut and make the "Target" debug\app.exe or .debug\app.exe or .\debug\app.exe Windows complains that the target does not exist. Is there any way to do this? Many thanks, Robert
-
I want to create a GUI shortcut to launch and executable that is in a nested directory. Specifically I need this shortcut to NOT need to know it's own directory name, i.e. I cannot supply the full path. The executable is in: C:\appdir-YYYYMMDD\debug\app.exe The shortcut is in directory: C:\appdir-YYYYMMDD The YYYYMMDD changes but I would like the shortcut to always run the executable that is nested below it. If I create a Shortcut and make the "Target" debug\app.exe or .debug\app.exe or .\debug\app.exe Windows complains that the target does not exist. Is there any way to do this? Many thanks, Robert
No, not without outside help. The shortcut has to have the directory name at least in it's "Start In" box. Without it, there is no telling what the current directory will be when the shortcut is launched, therefore, the shortcut will try to launch the app from a subdirectory of ANY directory that happens to be current at the time. An alternative would be to launch your application from a VBScript (*.vbs) file instead of a shortcut. Or, have a VBScript figure out what the path should be, then create a new shortcut with the appropriate information and launch that. Dave Kreskowiak Microsoft MVP - Visual Basic
-
No, not without outside help. The shortcut has to have the directory name at least in it's "Start In" box. Without it, there is no telling what the current directory will be when the shortcut is launched, therefore, the shortcut will try to launch the app from a subdirectory of ANY directory that happens to be current at the time. An alternative would be to launch your application from a VBScript (*.vbs) file instead of a shortcut. Or, have a VBScript figure out what the path should be, then create a new shortcut with the appropriate information and launch that. Dave Kreskowiak Microsoft MVP - Visual Basic
Thanks Dave. I won't bang my head any more. Robert :-)