- Thread Author
- #1
I have written a batch file (e.g.aaa.bat) which can take several paramters and runs fine as long as I enter the start command at the command prompt e.g
aaaa.bat -start -log
In order to avoid always having to enter manually this command I created a shortcut to this batch file and placed it in the SAME directory and added once the desired parameters. The shortcut properties look like now:
Target: D:\proj2\test2011\aaaa.bat -start -log
Start in: D:\proj2\test2011
This works fine as well. Now the problem comes: I want to make these batch file and its shortcut portable.
That means users should be abel to copy both files (batch + shortcut) on their computer in an indiviual different directory and be able to start the shortcutted batch file WITHOUT adjustments as well.
BUT this does not work because "Target" and "STarted in" most problably have a different path (e.g. C:\evalproj\task23\).
My first approaches to solve this problems were to omit the path like in:
Target: aaaa.bat -start -log
Start in: .
But this does not help. If I try to apply the settings above for the shortcut I got an error popup:
"The name aaa.bat' specified in the target box is not valid"
Hmm, how do I specify in the shortcut=SAME DIRECTORY AS CURRENT SHORTCUT FILE otherwise?
Target: .\aaaa.bat -start -log
does not work either. Are users really forced to modify the Target path parameter according to their execution directory?
Peter
aaaa.bat -start -log
In order to avoid always having to enter manually this command I created a shortcut to this batch file and placed it in the SAME directory and added once the desired parameters. The shortcut properties look like now:
Target: D:\proj2\test2011\aaaa.bat -start -log
Start in: D:\proj2\test2011
This works fine as well. Now the problem comes: I want to make these batch file and its shortcut portable.
That means users should be abel to copy both files (batch + shortcut) on their computer in an indiviual different directory and be able to start the shortcutted batch file WITHOUT adjustments as well.
BUT this does not work because "Target" and "STarted in" most problably have a different path (e.g. C:\evalproj\task23\).
My first approaches to solve this problems were to omit the path like in:
Target: aaaa.bat -start -log
Start in: .
But this does not help. If I try to apply the settings above for the shortcut I got an error popup:
"The name aaa.bat' specified in the target box is not valid"
Hmm, how do I specify in the shortcut=SAME DIRECTORY AS CURRENT SHORTCUT FILE otherwise?
Target: .\aaaa.bat -start -log
does not work either. Are users really forced to modify the Target path parameter according to their execution directory?
Peter