johnmcloud Posted July 13, 2011 Share Posted July 13, 2011 Hi community, i'm new here. My name is John I'd like to insert Macro in @ComSpec command. I have a .bat file with this script example: C:\Folder01\Start.exe -10 C:Folder02\End.exe The .bat working. I want to make a .exe with @WORKINGDIR and @ComSpec Command because i can't to write the exact directory for deploy to another my PC with a different folder position. I try: $var1 = @WorkingDir & '\Folder01\Start.exe' $var2 = '-10 ' $var3 = @WorkingDir & '\Folder02\End.exe' RunWait( @ComSpec & " /c " & $var1&$var2&$var3 ) But not work. I have use Macro in other ways, but in this case i don't now how to do. I'm a beginner, sorry Thanks Link to comment Share on other sites More sharing options...
LurchMan Posted July 13, 2011 Share Posted July 13, 2011 I think what you are looking for is @ScriptDir. It contains the directory that the script resides in. Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
johnmcloud Posted July 13, 2011 Author Share Posted July 13, 2011 (edited) browser problem. Sorry Edited July 13, 2011 by johnmcloud Link to comment Share on other sites More sharing options...
johnmcloud Posted July 13, 2011 Author Share Posted July 13, 2011 The script is correct? I have only sostitute the @workingdir with @scriptdir? Thanks Link to comment Share on other sites More sharing options...
LurchMan Posted July 13, 2011 Share Posted July 13, 2011 The script is correct?I have only sostitute the @workingdir with @scriptdir?Thanks It looks good from what I see, except you might want to do "$var1 & " " & $var2 & " " & $var3" so the variables have a space in between them for the command to work. Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
johnmcloud Posted July 13, 2011 Author Share Posted July 13, 2011 (edited) i'm test it... Edited July 13, 2011 by johnmcloud Link to comment Share on other sites More sharing options...
johnmcloud Posted July 13, 2011 Author Share Posted July 13, 2011 (edited) another browser error. Please sorry me. Edited July 13, 2011 by johnmcloud Link to comment Share on other sites More sharing options...
johnmcloud Posted July 13, 2011 Author Share Posted July 13, 2011 i'm test it...And don't work How can i do?P.s the script is in the main directory of the folder Link to comment Share on other sites More sharing options...
KaFu Posted July 13, 2011 Share Posted July 13, 2011 There were definitely some spaces missing, also check the console for output. $var1 = @WorkingDir & '\Folder01\Start.exe' $var2 = '-10 ' $var3 = @WorkingDir & '\Folder02\End.exe' $sCmd = @ComSpec & " /c " & $var1 & " " & $var2 & " " & $var3 ConsoleWrite($sCmd & @CRLF) RunWait($sCmd) OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
johnmcloud Posted July 13, 2011 Author Share Posted July 13, 2011 i have resolved I use msgbox for see "" and space. When everyting was ok I don't use @comspec but simply runwait($cmd) $cmd is equal to var1 / var2 / var3 Thanks for support John Link to comment Share on other sites More sharing options...
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