Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1  
Old 04-01-2004, 08:22 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,027
This seems to be a general problem when calling cmd /c FOR. One workaround is to put the FOR call in a batch file (which tests the exitcode itself and performs a no-op statement to force a 0 exitcode on success). This can be copied/pasted into VBP:



<step action='Write File' type='0'>
<Filename>%TEMP%\x.bat</Filename>
<Text><![CDATA[@FOR /R %TEMP% /D %%%%f IN (*.*) DO copy NUL "%%%%f\Vers_081.txt"
@IF %%ERRORLEVEL%% == 0 GOTO Done
@rem this executes another statement that will succeed so the callee gets a 0 exitcode
:Done]]></Text>
<description>Create a temporary batch file to perform a FOR command and ensure a 0 exitcode on success when called via cmd /c</description>
<indent type='3'>1</indent>
<name>create batch file</name>
</step>
<step action='Run Program' type='0'>
<command>%DOSCMD% call "%TEMP%\x.bat"</command>
<description>Call the temporary batch file that was created</description>
<indent type='3'>1</indent>
<name>call batch file</name>
<outputfrom type='3'>1</outputfrom>
</step>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 02:45 PM.


Copyright © 1999-2023 Kinook Software, Inc.