Jump to content

Recommended Posts

Posted (edited)

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
Posted

Hi Erham,

You can use the DirCreate function, search the help for it.

In your example, you cannot just run a dos command, lookup Run in the help and notice the part that mentions @COMSPEC

----[ SandyD ]---
Posted

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

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
  • Recently Browsing   0 members

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