johnmcloud Posted October 13, 2012 Posted October 13, 2012 (edited) Hi, it's me again... I'm going crazy, i'm lost 2hr...i have used Run 10000 time but this time i have problem with the brackets Script, with this paramenter work $exe = "C:\test_x86.exe" $install = "install" $exe2 = @WorkingDir & "\test2_x86.exe" $root = "root\test" RunWait(@ComSpec & " /k " & $exe & " " & $install & " " & '"' & $exe2 & '"' & " " & $root, @WorkingDir) But i need to use macro for the $exe $exe = "C:\test_x86.exe" ; Need to use @WorkingDir So i have make this: $exe = @WorkingDir & "\test_x86.exe" $install = "install" $exe2 = @WorkingDir & "\test2_x86.exe" $root = "root\test" RunWait(@ComSpec & " /k " & '"' & $exe & '"' & " " & $install & " " & '"' & $exe2 & '"' & " " & $root, @WorkingDir) But not work, give me error C:\Documents is a wrong path etc...classic error by path with space without brackets Do you know what is the funniest part? If i make: ConsoleWrite('"' & $exe & '"' & " " & $install & " " & '"' & $exe2 & '"' & " " & $root) And i copy/paste the result in a CMD window work... What is my error? Thanks Edited October 13, 2012 by johnmcloud
water Posted October 13, 2012 Posted October 13, 2012 What is variable $devcon_x86 used for? I can't find it in your script. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
johnmcloud Posted October 13, 2012 Author Posted October 13, 2012 I have edited the $variable, copy-paste error, sorry
water Posted October 13, 2012 Posted October 13, 2012 When you replace RunWait with ConsoleWrite and remove the @WorkingDir parameter you get:Consolewrite(@ComSpec & " /k " & '"' & $exe & '"' & " " & $install & " " & '"' & $exe2 & '"' & " " & $root). This writes the complete string to the console. I get: C:Windowssystem32cmd.exe /k "C:Temptest_x86.exe" install "C:Temptest2_x86.exe" roottestwhich doesn't look bad. What do you get? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
johnmcloud Posted October 13, 2012 Author Posted October 13, 2012 This is what i get: C:\Windows\System32\cmd.exe /k "C:Documents and SettingsMYNAMEDesktopTestTest_x86.exe" install "C:Documents and SettingsMYNAMEDesktopTestTest2_x86.exe" roottest As i have told you, if i copy-paste in cmd work, but with autoit the cmd output give me: "C:Documents" is not recognized as an internal or external command, operable program or batch file.
Developers Jos Posted October 13, 2012 Developers Posted October 13, 2012 Try: RunWait(@ComSpec & ' /k ""' & $exe & '" ' & $install & ' "' & $exe2 & '" ' & $root & '"', @WorkingDir) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
water Posted October 13, 2012 Posted October 13, 2012 (edited) Try it the other way round: RunWait(@ComSpec & " /k " & "'" & $exe & "'" & " " & $install & " " & "'" & $exe2 & "'" & " " & $root, @WorkingDir) Edited October 13, 2012 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
johnmcloud Posted October 13, 2012 Author Posted October 13, 2012 (edited) @Jos, the result is: ""C:Documents and SettingsMYNAMEDesktopTestTest_x86.exe"" is not recognized as an internal or external command, operable program or batch file. Cool, now i have four brackets @Water instead: The syntax of the file name, directory or volume is incorrect. Edited October 13, 2012 by johnmcloud
Developers Jos Posted October 13, 2012 Developers Posted October 13, 2012 Cool, now i have four brackets You mean Double Quotes I have see this before and know that enclosing the whole commandline with an extra set of double quotes did resolve it sometimes.You are running this under the same credentials right? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
johnmcloud Posted October 13, 2012 Author Posted October 13, 2012 Yeah, sure, same credentials I'm on XP right now so i can't run CMD like admin
water Posted October 13, 2012 Posted October 13, 2012 (edited) @Water instead: The syntax of the file name, directory or volume is incorrect. Could we just start the exe so we can see if the message comes from the OS or the application: RunWait(@ComSpec & " /k " & "'" & $exe & "'", @WorkingDir) Edited October 13, 2012 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
johnmcloud Posted October 13, 2012 Author Posted October 13, 2012 (edited) @WaterSame error, so:The syntax of the file name, directory or volume is incorrect.If i make this work:$exe = "C:Test_x86.exe" RunWait(@ComSpec & " /k " & $exe, @WorkingDir)With the quotes no...EDIT: Like this work:RunWait(@ComSpec & " /k " & '"' & $exe & '"', @WorkingDir)But if i add the second parameter ( the parameter has space inside ) i have the error C:Documents Edited October 13, 2012 by johnmcloud
water Posted October 13, 2012 Posted October 13, 2012 Runwait(@ComSpec & " /k " & '"' & $exe & '"')works here with Windows 7 64 bit. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
johnmcloud Posted October 13, 2012 Author Posted October 13, 2012 (edited) @Water It's not OS problem,if i make another tipe of command like: @ComSpec & " /c " & '"' & $exe & '" ' & $uninstall & " " & $root Work fine, or if i make the first or second parameter without " " and space work: $exe = @WorkingDir & "test_x86.exe" $install = "install" $exe2 = "C:test2_x86.exe" $root = "roottest" RunWait(@ComSpec & " /k " & '"' & $exe & '" ' & $install & " " & $exe2 & " " & $root, @WorkingDir) So if i have two path with space and " " inside the same Run not work Edited October 13, 2012 by johnmcloud
water Posted October 13, 2012 Posted October 13, 2012 Another question: You start $exe to install or uninstall $exe2? You would then have at least 2 levels of programs started by RunWait: Cmd.exe -> $exe No wonder that it gets complex. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
johnmcloud Posted October 13, 2012 Author Posted October 13, 2012 YEAH!I have make totally random quotes until Autoit accept it lol$exe = '""' & @WorkingDir & "\Test_x86.exe" & '"' $install = "install" $exe2 = '"' & @WorkingDir & "\Test2_x86.exe\" & '""' $root = "root\test" RunWait(@ComSpec & " /k " & " " & $exe & " " & $install & " " & $exe2 & " " & $root, @WorkingDir)Thanks for the support Water and Jos
water Posted October 13, 2012 Posted October 13, 2012 Glad you got it working My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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