Jump to content
Sign in to follow this  
Guest cperago

_rundos and multiple commands

Recommended Posts

Guest cperago

I am trying to create an autoit script and I am having trouble getting the script to run a two part DOS command.

Here is the batch file version of the two commands:

c:\BDMP\memberof -q | find /i "[Department-Business Valuation]"

if %ERRORLEVEL%*==0* net use U: \\dc2por\Valuations /PERSISTENT:NO

How can I use _rundos(...) to include both commands. The first line return the error level and the second line uses the result. If I run two _rundos commands I loose the variable (I think it creates a new dos session for each command) and it does not work. Can I put two command in one _rundos line to maintain the errorlevel and still have the commands run....how?

Edited by cperago

Share this post


Link to post
Share on other sites

use runwait for each command, it will return the errorlevel,

Alternatively, call both commands as one batch file ...

lookup @COMSPEC and RunWait() in the help.

Edited by flyingboz

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...