Jump to content

Help running multiple commands with dos prompt


Recommended Posts

Hi,

I have this problem:

- I need to run a the windows command line cmd.exe.

- from this command to run batch file called qatools.bat

- I need to redirect the log console input to file named test.txt.

- when the batch run I need to send some parameters to the batch and make sure the file is populated with data

So, i wrote something like that:

RunWait(@ComSpec & ' /c cd C:\BSCSimulators' & _

'& qatools.bat > c:\test.log' & _

'& 1' & _

'& 23' & _

'& 1' & _

'& +2', '', @SW_HIDE)

my problem is that the optional parameters (1, 23,1 and +2) are not executing well.

What am I should do?

Be Green Now or Never (BGNN)!

Link to comment
Share on other sites

my problem is that the optional parameters (1, 23,1 and +2) are not executing well.

What am I should do?

Looks like "command & command & command & command" to me rather then optional parameters. :)

This removes the 1st command of CD, but you still may need to fix the rest.

RunWait(@ComSpec & ' /c ' & _
'qatools.bat > c:\test.log' & _
'& 1' & _
'& 23' & _
'& 1' & _
'& +2', 'C:\BSCSimulators', @SW_HIDE)
Link to comment
Share on other sites

Looks like "command & command & command & command" to me rather then optional parameters. :)

This removes the 1st command of CD, but you still may need to fix the rest.

RunWait(@ComSpec & ' /c ' & _
'qatools.bat > c:\test.log' & _
'& 1' & _
'& 23' & _
'& 1' & _
'& +2', 'C:\BSCSimulators', @SW_HIDE)
What do you mean ""command & command & command & command" ?

This parameters are simmilar to key stroke send(1{Enter})...because it response to menue options.

How do I do those commands

Be Green Now or Never (BGNN)!

Link to comment
Share on other sites

What do you mean ""command & command & command & command" ?

This parameters are simmilar to key stroke send(1{Enter})...because it response to menue options.

You are telling the wrong interpreter with this information. CMD does not know the commands that you are passing.

Character:

& [...]

Syntax:

command1 & command2

Definition:

Use to separate multiple commands on one command line. Cmd.exe runs the first command, and then the second command.

How do I do those commands

Not enough information for me to understand what you are trying to do. :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...