Erhnam Posted January 23, 2007 Posted January 23, 2007 (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 January 23, 2007 by Erhnam
sandyd Posted January 23, 2007 Posted January 23, 2007 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 ]---
Danny35d Posted January 23, 2007 Posted January 23, 2007 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now