stg68 Posted May 24, 2012 Posted May 24, 2012 (edited) Can't make it work when spaces are in the directory names. Tried the following:FYI (c:tempnew folder) is a @ScriptDirCMD DOS (batch) WORKS"c:tempMy Folderappspsloglist.exe" -accepteula -d 14 Application > "c:tempmy Folderout12.txt"AutoIT Does NotRunWait(@ComSpec & ' /c "'&@ScriptDir&'appspsloglist.exe" -accepteula -d 14 Application > "'&@ScriptDir&'out12.txt"','',@SW_SHOWNORMAL)Please help Edited May 24, 2012 by stg68
water Posted May 24, 2012 Posted May 24, 2012 You need something like this: RunWait(@ComSpec & ' /c ' & @ScriptDir & 'appspsloglist.exe -accepteula -d 14 Application > "c:tempmy Folderout12.txt"' 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
stg68 Posted May 24, 2012 Author Posted May 24, 2012 (edited) Thank you for your assistance.Here is what cmd error I got by changing /c to /k to see the error'C:tempMy' is not recognized as an internal or external command,operable program or batch file.C:tempMy Folder> Edited May 24, 2012 by stg68
water Posted May 24, 2012 Posted May 24, 2012 The ending bracket was missing: RunWait(@ComSpec & ' /c ' & @ScriptDir & 'appspsloglist.exe -accepteula -d 14 Application > "c:tempmy Folderout12.txt"') 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
stg68 Posted May 24, 2012 Author Posted May 24, 2012 I noticed and fixed it before i run it again. So, the error the same Thank you
water Posted May 24, 2012 Posted May 24, 2012 Or this:RunWait(@ComSpec & " /c " & @ScriptDir & "appspsloglist.exe -accepteula -d 14 Application >""c:tempmy Folderout12.txt""") 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
stg68 Posted May 24, 2012 Author Posted May 24, 2012 Not sure if it is helpful, but when autoit script runs the batch file with runwait and bat file has the only this line below it works: "c:tempMy Folderappspsloglist.exe" -accepteula -d 14 Application > "c:tempmy Folderout12.txt"
water Posted May 24, 2012 Posted May 24, 2012 I see. The path to the exe has spaces too. Then you need: RunWait(@ComSpec & ' /c "' & @ScriptDir & '\apps\psloglist.exe" -accepteula -d 14 Application > "c:\temp\my Folder\out\12.txt"') 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
water Posted May 24, 2012 Posted May 24, 2012 Just to verify, what do you get when you run: ConsoleWrite(@ComSpec & ' /c "' & @ScriptDir & 'appspsloglist.exe" -accepteula -d 14 Application > "c:tempmy Folderout12.txt"' & @CRLF) 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
stg68 Posted May 24, 2012 Author Posted May 24, 2012 This >"C:Program Files (x86)AutoIt3SciTE..autoit3.exe" /ErrorStdOut "C:tempMy FolderLogs.au3" C:\Windows\System32\cmd.exe /c "C:tempMy Folderappspsloglist.exe" -accepteula -d 14 Application > "c:tempmy Folderout12.txt" >Exit code: 0 Time: 0.216
Xenobiologist Posted May 24, 2012 Posted May 24, 2012 Looks good :-) Are you sure about the parameters? Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
water Posted May 24, 2012 Posted May 24, 2012 (edited) Another try. Let's specify a working directory: RunWait(@ComSpec & ' /c "' & @ScriptDir & 'appspsloglist.exe" -accepteula -d 14 Application > "c:tempmy Folderout12.txt"', @ScriptDir & 'apps') Edited May 24, 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
water Posted May 24, 2012 Posted May 24, 2012 OK, let's do it step by step. Just call the application without redirecting the output: RunWait(@ComSpec & ' /c "' & @ScriptDir & '\apps\psloglist.exe" -accepteula -d 14 Application') 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
water Posted May 24, 2012 Posted May 24, 2012 Fine, next step is to add the redirection using a path without spaces: RunWait(@ComSpec & ' /c "' & @ScriptDir & '\apps\psloglist.exe" -accepteula -d 14 Application>C:\temp\test.txt') Is there a file C:\temp\test.txt with the correct content? 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
stg68 Posted May 24, 2012 Author Posted May 24, 2012 C:temptest.txt file created with the correct content
water Posted May 24, 2012 Posted May 24, 2012 Fine, now we put some quotes around it and save to "C:\temp\test2.txt":RunWait(@ComSpec & ' /c "' & @ScriptDir & '\apps\psloglist.exe" -accepteula -d 14 Application>"C:\temp\test2.txt"') 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