Kinook Software Forum

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

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-10-2003, 11:04 PM
peterxcollins peterxcollins is online now
Registered User
 
Join Date: 05-08-2003
Posts: 2
Multiple dos cmds in a cmd box does not seem to work

in win xp if i go to a dos box ( via run , cmd ) and type at the cmd prompt,

echo Hello & dir & echo hello again

I get

H:\tmp>
H:\tmp>echo Hello & dir & echo hello again
Hello
Volume in drive H is Homedirs
Volume Serial Number is E4A4-69C6

Directory of H:\tmp

11/09/2003 01:59 PM <DIR> .
11/09/2003 01:59 PM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 8,605,827,072 bytes free
hello again


which id the expected output.

But if i put the same command in Progam/command VB pro gives

Failed to create process: The system cannot find the file specified.


Should not i get the same output as from the dos command line - or how do i enter multiple dos commands in the one command box , without piping
Reply With Quote
  #2  
Old 09-11-2003, 06:31 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Command shell capabilities such as internal commands like echo, dir, copy, etc., and multiple commands (&), piping (|), and redirection (> >>) are implemented by the Command Interpreter (cmd.exe). Prefix your command string with '%DOSCMD% ' to have it run under the command interpreter and enable this functionality; otherwise VBP will attempt to execute the program 'echo'. This is the explanation from the 'Run Program' help topic (looks like it needs to be updated to mention & as well):

Note: To run batch files (.bat), command scripts (.cmd), or individual shell commands, the command should be prefixed with the DOSCMD system macro (i.e., %DOSCMD% "C:\MyBatch.bat" arg1 arg2 or %DOSCMD% copy "%PROJDIR%\Test.exe" \\server\deploy) so that the command is executed under a command shell/interpreter. Also, if you need to redirect (> or >>) or use piping (|) on the output of an executable, the command should also be prefixed with DOSCMD, since the command interpreter is what implements redirection/piping.
Reply With Quote
  #3  
Old 09-11-2003, 08:03 PM
peterxcollins peterxcollins is online now
Registered User
 
Join Date: 05-08-2003
Posts: 2
I made a mistake. I understand why need to have '%DOSCMD% .
I can not believe i missed the problem , but i did.
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 04:12 PM.


Copyright © 1999-2023 Kinook Software, Inc.