View Single Post
  #4  
Old 03-21-2004, 10:19 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 5,754
To get an equivalent comparison with what VBP is doing when executing internal OS commands, create a .cmd script that looks like this:

cmd /c FOR /R D:\Directory /D %%f IN (*.*) DO COPY NUL %%f\Vers_081.txt
echo %ERRORLEVEL%

I'll bet that if you run this from a Command Prompt you'll get the same errorlevel/exitcode behavior as inside VBP (on Win XP, it shows an exitcode of 2012907760). The cmd /c part is necessary from within VBP since 'copy' is implemented by the command interpreter. I'm not sure why cmd.exe produces a different exitcode in this situation, but it sounds like a bug in Windows (unless there's something about the statement syntax that isn't technically valid, but then you would expect it to fail without doing anything).
Reply With Quote