pintas Posted January 15, 2009 Posted January 15, 2009 I'm trying to run a custom exe in command prompt using a environment variable, but when i use "" it simply doesn't work. The dos program i'm using needs double quotes to work with files. Can anyone help me out please? Here's the script i'm trying to get working: Run('prog.exe copy "%appdata%\file.txt" -param',"",@SW_HIDE)
azure Posted January 15, 2009 Posted January 15, 2009 I'm trying to run a custom exe in command prompt using a environment variable, but when i use "" it simply doesn't work. The dos program i'm using needs double quotes to work with files. Can anyone help me out please? Here's the script i'm trying to get working: Run('prog.exe copy "%appdata%\file.txt" -param',"",@SW_HIDE) Double Quotes? like this? Run('prog.exe copy ""%appdata%\file.txt"" -param',@SYSTEMDIR,@SW_HIDE)
pintas Posted January 15, 2009 Author Posted January 15, 2009 (edited) No, i mean like this: "%appdata%\file.txt" Autoit needs the "" to work so that variable inside is completetly disregarded. In the command prompt it would look like exactly like this what i'm trying to accomplish via autoit: C:\> prog.exe copy "%appdata%\file.txt" -param Edited January 15, 2009 by pintas
cramaboule Posted January 15, 2009 Posted January 15, 2009 I'm trying to run a custom exe in command prompt using a environment variable, but when i use "" it simply doesn't work. The dos program i'm using needs double quotes to work with files. Can anyone help me out please? Here's the script i'm trying to get working: Run('prog.exe copy "%appdata%\file.txt" -param',"",@SW_HIDE) 1. Look under ShellExecute() Run() can Only execute EXE, BAT, COM, or PIF 2. %appdata% -> $myvar&"file.txt" (@AppDataDir&"file.txt" or @AppDataCommonDir&"file.txt" as well !) Cram... My Autoit programs: MAC Address - - Delete Temp Files - - Ping Test - - Play Video with VLC full screen dual monitors - - Set IP - - Pics Converter - - AutoUpdater - - CPU Usage - - Ending Script Nicely - - GDI+ GUI crossfades (slide transitions) - - Beamer - - Search and Search in Files - - Silent Ninite Others: Export Icons into Dll - - My website
azure Posted January 15, 2009 Posted January 15, 2009 prog.exe copy "%appdata%\file.txt" -param Try this: Run(@COMSPEC & ' /c prog.exe copy "%appdata%\file.txt" -param',@SYSTEMDIR,@SW_HIDE)
pintas Posted January 15, 2009 Author Posted January 15, 2009 (edited) Somehow with the '@SYSTEMDIR' it just doesn't work. The program doesn't run. If i remove the @SYSTEMDIR, the program runs, but it doesnt understand the command. I didn't quite understand it... should i copy the proggy.exe to the systemdir? Any other way to do it? Thanks for your help Edited January 15, 2009 by pintas
azure Posted January 15, 2009 Posted January 15, 2009 Somehow with the '@SYSTEMDIR' it just doesn't work. Nothing happens.I didn't quite understand it... should i copy the proggy.exe to the systemdir?Any other way to do it?Thanks for your help Oh... well no. you can change it to @SCRIPTDIR if prog.exe is in the same directory as your script. That's the working directory. I just use @SYSTEMDIR as a filler if the program I'm running is in the system path (accessible from anywhere).
pintas Posted January 15, 2009 Author Posted January 15, 2009 LOL. I forgot to try that. It works beautifully! If i was gay i would kiss you. LOL Thanks man
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