I have a bat file which can batch covert SVG to PNG.
Normal Way:
I can move it to the desire folder(contains SVG file) eg. D:\svg\ then launch the bat file. ---it works.
But I don't wanna always have to move that bat file to the desire folder with SVG, so I tried to create a button.
TC Way:
1. I just drag the bat file to the toolbar. I only changed the Start Path to %P. ---When I navigated to the desire folder on TC then click the button, it failed.
2. While if I changed the Start Path to exactly D:\svg\, the I navigated to a random folder on TC, it works(Of course it works, I know)
But why %P doesn't work? And how to make it(TC Way 1) works??
Thanks in advance.
Regards
Bat file as a button, how to setup Start Path (SOLVED)
Moderators: white, Hacker, petermad, Stefan2
Bat file as a button, how to setup Start Path (SOLVED)
Last edited by Dwhite on 2020-04-07, 12:04 UTC, edited 1 time in total.
- sqa_wizard
- Power Member
- Posts: 3864
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Re: Bat file as a button, how to setup Start Path
Using a start path means: all filenames without path are used at this start path or the folders at PATH environment.
If your batch file starts a program (e.g. the converter) or uses a file (e.g. the file to convert) you have use a notation with path.
If your batch file starts a program (e.g. the converter) or uses a file (e.g. the file to convert) you have use a notation with path.
#5767 Personal license
Re: Bat file as a button, how to setup Start Path
Dwhite,
Try leaving the start path empty.
HTH
Roman
Try leaving the start path empty.
HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Re: Bat file as a button, how to setup Start Path
@sqa_wizerd
OK got it.
@Hacker
Yeah, it works!
thank you.
OK got it.
@Hacker
Yeah, it works!
thank you.
Re: Bat file as a button, how to setup Start Path
Out of Topic
Drag'n Drop is not the best way to work with button in TC because all the parameters are replaced by the first selected file full path name..
Start path only accept full path definition none of the %P %T are interpreted ..
If you use a lot your bat file with D'nD, you should make it more robust and make it works from anywhere using only full name as single parameter.
From a parameter inside your bat file, you can use %~dp1 to get full path of the parameter file and cd /d "%~dp1" to go to the file folder...
Drag'n Drop is not the best way to work with button in TC because all the parameters are replaced by the first selected file full path name..
Start path only accept full path definition none of the %P %T are interpreted ..
If you use a lot your bat file with D'nD, you should make it more robust and make it works from anywhere using only full name as single parameter.
From a parameter inside your bat file, you can use %~dp1 to get full path of the parameter file and cd /d "%~dp1" to go to the file folder...
Re: Bat file as a button, how to setup Start Path (SOLVED)
thx for the tips