mrjoli021 Posted June 25, 2012 Share Posted June 25, 2012 I am running run (command.exe > testing.txt) it says that ">" is an invalid parameter. When I run the same command from the command line it works. Link to comment Share on other sites More sharing options...
Mechaflash Posted June 25, 2012 Share Posted June 25, 2012 AutoIt isn't Windows Command Line =D. However you can call the windows command line in AutoIt XD Run(@Comspec & ' /c "command.exe" > "testing.txt"') Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
water Posted June 25, 2012 Share Posted June 25, 2012 IIRC the space preceding the pipe character or the one following the pipe character or both have to be removed ;-) My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Mechaflash Posted June 25, 2012 Share Posted June 25, 2012 IIRC the space preceding the pipe character or the one following the pipe character or both have to be removed ;-) heh? Whtchu talkin bout willis? $hFile = FileOpen("C:test.txt", 1) FileWrite($hFile, "Test Line") FileClose($hFile) Run(@Comspec & ' /c type "C:test.txt" > "C:testing.txt"') works fine Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
water Posted June 25, 2012 Share Posted June 25, 2012 That's why I started with "IIRC" - If I remember correctly. I always can be wrong My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
mrjoli021 Posted June 25, 2012 Author Share Posted June 25, 2012 Thx Link to comment Share on other sites More sharing options...
mrjoli021 Posted June 25, 2012 Author Share Posted June 25, 2012 I am trying to use WUInstall to update windows but when I run the command it takes a while to complete but using Run(@Comspec & ' /c "WUInstall.exe" > "testing.txt"') completes really fast and the result of testing.txt is a short description. I need for the command to complete. Link to comment Share on other sites More sharing options...
mrjoli021 Posted June 25, 2012 Author Share Posted June 25, 2012 I got it working but how do I add variables to this command$computer=@ComputerName&".txt"RunWait(@Comspec & ' /c "WUInstall.exe /search > $computer')this saves it with a name of $computer instead of the computername.txt Link to comment Share on other sites More sharing options...
Exit Posted June 25, 2012 Share Posted June 25, 2012 (edited) runwait ? edit : too late Edited June 25, 2012 by forumer100 App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
BrewManNH Posted June 25, 2012 Share Posted June 25, 2012 I got it working but how do I add variables to this commandthis saves it with a name of $computer instead of the computername.txtRunWait(@Comspec & ' /c WUInstall.exe /search >' & $computer), this should work. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Exit Posted June 25, 2012 Share Posted June 25, 2012 (edited) RunWait(@Comspec & ' /c "WUInstall.exe /search > ' & $computer) edit: again too late Edited June 25, 2012 by forumer100 App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
mrjoli021 Posted June 25, 2012 Author Share Posted June 25, 2012 it give me an error Link to comment Share on other sites More sharing options...
BrewManNH Posted June 25, 2012 Share Posted June 25, 2012 it give me an errorThat's not at all helpful. What gives you an error, and what is the error? If you expect to be helped, help us help you. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
mrjoli021 Posted June 25, 2012 Author Share Posted June 25, 2012 RunWait(@Comspec & ' /c "WUInstall.exe" /search > '$computer) RunWait(^ ERROR Link to comment Share on other sites More sharing options...
Mechaflash Posted June 25, 2012 Share Posted June 25, 2012 (edited) it's a PEBKAC issue...Either learn to copy & paste or read the code Brew gave you carefully. Notice the placements of ampersands and quotes ( & and ' ) Edited June 25, 2012 by mechaflash213 Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
BrewManNH Posted June 25, 2012 Share Posted June 25, 2012 RunWait(@Comspec & ' /c "WUInstall.exe" /search > '$computer) RunWait(^ ERROR You mistyped the command line, there's supposed to be an ampersand inbetween the final ' and $computer. RunWait(@Comspec & ' /c WUInstall.exe /search >' & $computer) This is what it should look like, you had quotes in the wrong places, and you didn't connect the line correctly. BTW, this is what I gave you several posts back. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator 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