![Confused :?](./images/smilies/icon_confused.gif)
Zip a file
Moderators: chulett, rschirm, roy
infact this is the error message i am getting
"BeforeJob (ExecDOS): Error when executing command: zipfile.bat
*** Output from command was: ***
'zipfile.bat' is not recognized as an internal or external command,
operable program or batch file."
batchfile code:
c:
cd program files
cd winrar
winrar.exe a D:\TEST\abc.zip D:\TEST\abc.txt
"BeforeJob (ExecDOS): Error when executing command: zipfile.bat
*** Output from command was: ***
'zipfile.bat' is not recognized as an internal or external command,
operable program or batch file."
batchfile code:
c:
cd program files
cd winrar
winrar.exe a D:\TEST\abc.zip D:\TEST\abc.txt
You didn't need to change your .bat file, just how you called it in the stage. It couldn't find it because that directory is not in your $PATH (as you noticed) so just fully path the command.
Meaning, than executing "zip.bat", execute "C:\temp\zip.bat" instead, of course after replacing the path I used with your real one. And your first batch file 'cd' commands would have worked better than your new one as you never told it where to 'cd' to. Never mind that they really aren't needed if you've successfully amended the PATH in your batch... or if you fully path that .exe as well, much like the zip batch.
ps. All this is your basic "command line 101" entry level stuff, but I'm guessing this is foreign territory to you. This would be a good (as in useful) skill for you to pick up as it will help you in both the Windows/DOS and UNIX worlds.
Meaning, than executing "zip.bat", execute "C:\temp\zip.bat" instead, of course after replacing the path I used with your real one. And your first batch file 'cd' commands would have worked better than your new one as you never told it where to 'cd' to. Never mind that they really aren't needed if you've successfully amended the PATH in your batch... or if you fully path that .exe as well, much like the zip batch.
ps. All this is your basic "command line 101" entry level stuff, but I'm guessing this is foreign territory to you. This would be a good (as in useful) skill for you to pick up as it will help you in both the Windows/DOS and UNIX worlds.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
In your BATCH FILE You can put PAUSE....
If in case you want see error occured in BATCH FILE you can use following code---------->
echo ERRORLEVEL %ERRORLEVEL%
IF %ERRORLEVEL% == 1 (SET ERRORLEVEL=0)
echo ERRORLEVEL %ERRORLEVEL%
-----------------------------------------------------
If in case you want see error occured in BATCH FILE you can use following code---------->
echo ERRORLEVEL %ERRORLEVEL%
IF %ERRORLEVEL% == 1 (SET ERRORLEVEL=0)
echo ERRORLEVEL %ERRORLEVEL%
-----------------------------------------------------
basu.ds wrote:yes,i ran from cmd but i am getting just blink screen while running this batch file ,nothing is asking
thanks
You are getting blink screen because....
batch file executes it's code immedialtely on command prompt
and you didnt entered error handling or PAUSE command in BATCH file code.......
batch file executes it's code immedialtely on command prompt
and you didnt entered error handling or PAUSE command in BATCH file code.......
basu.ds wrote:yes,i ran from cmd but i am getting just blink screen
while running this batch file ,nothing is asking
thanks
Last edited by qutesanju on Mon Jun 01, 2009 6:26 am, edited 1 time in total.