Jump to content
Sign in to follow this  
JLC123

.bat file requires switch

Recommended Posts

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
Guest Py7|-|[]/\/

You want to edit a DOS file and add 123 to it?

Share this post


Link to post
Share on other sites

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
Guest Py7|-|[]/\/

I don't understand, sorry.

Share this post


Link to post
Share on other sites

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

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...