Jump to content

Using Run and variables


Erhnam
 Share

Recommended Posts

I want use variables within my Run command. Is this possible. The MsgBox seems to pop-up without any problems. Now the next step to create a directory using the variable. How can I do this?

$var = String("C:\Test")

MsgBox(4096, "Path variable is:", $var)

Run("cmd /c mkdir" & $var, "", @SW_MAXIMIZE)

Edited by Erhnam
Link to comment
Share on other sites

I will use sandyd suggestion DirCreate() function, but referring to Run() function you didn't leave a space between mkdir and quotes. Another thing I will @ComSpec macro instead of cmd.

Run(@ComSpec & " /c mkdir " & $var, "", @SW_MAXIMIZE)

Without the space between mkdir and quotes run command look like mkdirC:\Test instead of mkdir C:\Test

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
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...