Buggy pre/post command execution
Let's test following script (test.cmd):
@echo off
if not exist %~1 (
echo Directory %~1 NOT exist >>"test.log"
) else (
echo Directory %~1 exists >>"test.log"
)
echo. >>"test.log"
This script just tests specified in the first argument directory/file for existence and outputs resulting string to test.log. Here are the examples of execution:
1. test.cmd n:\backups
Result: Directory n:\backups exists
2. test.cmd n:\backups\
Result: Directory n:\backups\ exists
3. test.cmd n:\backups\foo
Result: Directory n:\backups\foo NOT exist (and that is true)
Now lets add that script as post command for any backup task (command: t:/test/test.cmd, work dir: t:/test, arguments: n:\backups\) and press Test button. The result written in test.log is: Directory n:\backups NOT exist
I also found that command execution as pre/post command fails in calling another cmd.exe, if's, for's. Why?!!! Why the result is so different?
- Log in to post comments
See the topic I specified above, there is information about this error. Topic might be closed.
- Log in to post comments