PDA

View Full Version : Custom Button and Batch Files



pyesnosky
March 10th, 2005, 09:48 PM
I'm using DL Pro and just upgraded to the latest version. I'm trying to run a batch file from the custom button in a way that is very similar to the tip that is in the FAQ. But, it isn't working for me.

If I put the following in the custom button command line:

C:\foo.cmd %d

I get the following error:

Error trying to execute command:
ENOENT: File or path not found
cmd:
arg0:
arg1: C:\foo.cmd
arg2: "this is filled with the download directory"

and of course the batch file does not start.

If I just press the custom button a second time, the same thing happens but the cmd: line and arg0: line are filled with garbage characters as if there is some pointer to nowhere problem or bad initialization of a variable, etc.

If I set up the exact same test, but leave off the %d, then the batch file executes properly. In other words:

C:\foo.bat

Does execute the batch file fine but of course is pretty useless because I need the directory parameter.

What am I missing? This is very simple and exactly like the FAQ.

I am running XP SP2 and the latest version of DL Pro.

Thanks,

Paul

Gary_Berg
March 11th, 2005, 04:14 PM
Try using something like:

cmd.exe /cfoo.cmd ....

Make it a program, not a batch file, that is run.

Chris Breeze
March 11th, 2005, 06:36 PM
It worked with .BAT files last time I tried it. I will do some tests on Monday.

pyesnosky
March 16th, 2005, 03:15 AM
More update from me regarding this problem.

I tried using a batch file instead of a cmd file and that works.

I was under the impression that the new XP %~ constructs for arguments only worked in cmd files but they work in batch files as well so all is okay.

But, if you have a .cmd at the end instead of .bat, the file does not work. Good to know.

I have one other question related to this, but I will post that question in a new thread.

Thanks, Paul