I keep screwing up a batch file I'm making. Any help?

aimeeandbeatles

watermelon
Joined
Apr 5, 2007
Messages
20,112
I'm trying to make a batch file that'll do some things in one directory, then navigate to a specific directory on another drive and launch an executable in there. (I'll post more info if needed)

I got the "some things" part working right, but for some reason, I keep getting errors that Windows can't find the specific executable I'm asking for and asking me if I mistyped it or something. When I start a command prompt in the directory itself and try to launch the file that way, it's fine.

I'm not sure what exactly's messing up, but I have a hunch perhaps the change of drive.

Then I got frustrated, which was stupid, and deleted the batch file so I can't post it, or I would. Can somebody post an example of what it should look like so I can try again?
 
I'm trying to make a batch file that'll do some things in one directory, then navigate to a specific directory on another drive and launch an executable in there. (I'll post more info if needed)

I got the "some things" part working right, but for some reason, I keep getting errors that Windows can't find the specific executable I'm asking for and asking me if I mistyped it or something. When I start a command prompt in the directory itself and try to launch the file that way, it's fine.

I'm not sure what exactly's messing up, but I have a hunch perhaps the change of drive.

Then I got frustrated, which was stupid, and deleted the batch file so I can't post it, or I would. Can somebody post an example of what it should look like so I can try again?

What OS? Are you sure the command is supported by the OS in the way you call it?
 
Windows. Yes, the commands worked as I tested them all independently. Its when I combined them that it broke.
 
If you switch directories across drives using cd, you have to use the /[driveletter] parameter.
So if you are on drive C and want to go to D:\bla, where your executable is located, you'd have to write "cd /d d:\bla". I hope that makes sense.
My suspicion is that you instead used "cd d:\bla", which does nothing if you are on drive c, and therefore the programme failed to launch.
 
I think that's it!

I'll give it a shot. Thank you.
 
Back
Top Bottom