Jump to content
Sign in to follow this  
JLC123

.bat file requires switch

Recommended Posts

JLC123

OK, making good progress, but I hit a wall! Here's what I need to do, but can't figure out:

I need an inputbox where the user will enter a desired number, that number needs to be passed to a batch file as the desired switch. i.e.

dothis.bat 123 where 123 is the value entered by the user. Make sense? I hope so, cuz I'm getting a headache.


Two wrongs don't make a right, but three lefts do

Share this post


Link to post
Share on other sites
JLC123

No, the 123 is a switch (actually a variable) required by the batch file I'm calling. the syntax of the batch file is dothis.bat ???? - I need the user to give me the ????


Two wrongs don't make a right, but three lefts do

Share this post


Link to post
Share on other sites
JerryD

OK, making good progress, but I hit a wall! Here's what I need to do, but can't figure out:

I need an inputbox where the user will enter a desired number, that number needs to be passed to a batch file as the desired switch. i.e.

dothis.bat 123 where 123 is the value entered by the user. Make sense? I hope so, cuz I'm getting a headache.

<{POST_SNAPBACK}>

:)

Why don't you use the commands the batch file uses within the AutoIT script? If the batch file is looking for a paramater on the command line, it will appear as %1 in the batch file. If the batch file says:

command1 %1

command2 %1

use

$Ret = InputBox( "title", "Prompt")

to get the user's input, then use RunWait like this:

RunWait ( @ComSpec & " /c path\command1 " & $Ret, path, @SW_HIDE )

RunWait ( @ComSpec & " /c path\command2 " & $Ret, path, @SW_HIDE )

and you won't get any DOS box flashing or appearing on the task bar.

Share this post


Link to post
Share on other sites
JLC123

:)

Thanks! Headache's gone now.


Two wrongs don't make a right, but three lefts do

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.