hottschott Posted May 6, 2009 Share Posted May 6, 2009 Hello all,I am extremely new to Autoit, so please excuse me if this is a very noobly question =)This is what I am trying to do:RunAs ("administrator", 0, "nothingtoseehere", 64, "cmd.exe")WinWaitActive ("Administrator: C:\Windows\system32\cmd.exe")Send ("taskkill /f /im nlnotes.exe")Send ("{ENTER}")Send ("taskkill /f /im notes2w.exe")Send ("{ENTER}")Send ("taskkill /f /im ntaskldr.exe")Send ("{ENTER}")WinClose ("IBM Lotus Notes")Send ("cd c:\windows")Send ("{ENTER}")Send ("rmdir /s /q c:\windows\temp")Send ("{ENTER}")WinClose ("Administrator: C:\Windows\system32\cmd.exe")Run ("cmd.exe")WinWaitActive ("C:\Windows\system32\cmd.exe")Send ("pause")Send ("{ENTER}")Send ("a")Send (" cd %userprofile%\appdata\local")Send ("{ENTER}")Send (" rmdir /s /q %userprofile%\appdata\local\temp")Send ("{ENTER}")Send ("cd c:\lotus\notes\")Send ("{ENTER}")Send ("type notes.ini | find "[Notes]" >notes.txt") ------Everything works wonderfully until I get to here.Send ("{ENTER}") --------I know its because i have Notes in brackets, and autoit thinks im trying to flag it.Send ("type notes.ini | find "Directory=" >>notes.txt") Send ("{ENTER}")Send ("type notes.ini | find "DskMgrPckPath=" >>notes.txt") -- It also doesnt like my =, or my >>. Also, I think it has something to do with my doubleSend ("{ENTER}") ------------------------- ----- quotation marks. I have quotations within a quotation. Im just trying to send commands to the command promptSend ("ren notes.ini notes.old.bak")Send ("{ENTER}")Send ("ren notes.txt notes.ini")Send ("{ENTER}")WinClose ("C:\Windows\system32\cmd.exe")Run ("notes.exe")If anyone can help, I would very much appreciate it! Link to comment Share on other sites More sharing options...
Skruge Posted May 6, 2009 Share Posted May 6, 2009 Brackets are fine. It's the double quotes. Here are two ways to get around this.Send ("type notes.ini | find ""[Notes]"" >notes.txt") ; Double-double ... Send ('type notes.ini | find "DskMgrPckPath=" >>notes.txt') ; Single/double Although, you'd probably be better off writing all this stuff to a batch file and calling that, or converting the logic to pure AutoIt functions. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
hottschott Posted May 6, 2009 Author Share Posted May 6, 2009 Brackets are fine. It's the double quotes. Here are two ways to get around this.Send ("type notes.ini | find ""[Notes]"" >notes.txt") ; Double-double ... Send ('type notes.ini | find "DskMgrPckPath=" >>notes.txt') ; Single/double Although, you'd probably be better off writing all this stuff to a batch file and calling that, or converting the logic to pure AutoIt functions. Wow. Thank you so much. Something so little makes such a huge difference. I have been at this all morning. Really appreciate the quick reply. The only reason why I dont want to have this call a batch file is because i want it all contained in one file. I want to send this out as an exe for all of our users who are having this certain issue with their lotus notes crashing. Just a one stop shop to click it and not have to worry about them having network access or multiple files. What do you mean by converting the logic to pure autoit functions? Link to comment Share on other sites More sharing options...
Highcommander Posted May 6, 2009 Share Posted May 6, 2009 Although, you'd probably be better off writing all this stuff to a batch file and calling that, or converting the logic to pure AutoIt functions.I was thinking the same thing whey i read the title of this thread. I use to dabble with batch files, they are simple to write and you can call them with autoit. Here is a link that gives you what you need to write those cmd calls: http://www.computerhope.com/batch.htm#02 Link to comment Share on other sites More sharing options...
BrettF Posted May 6, 2009 Share Posted May 6, 2009 There are built in INI functions, ProcessClose etc? Whats wrong with using the built in AutoIt functions? And I find writing to a batch file pretty silly... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Skruge Posted May 6, 2009 Share Posted May 6, 2009 The only reason why I dont want to have this call a batch file is because i want it all contained in one file. I want to send this out as an exe for all of our users who are having this certain issue with their lotus notes crashing. Just a one stop shop to click it and not have to worry about them having network access or multiple files.You can use FileWrite/FileWriteLine/FileInstall to generate the batch file, then run it and delete it. In this sense, you still only need to distribute a single EXE. What do you mean by converting the logic to pure autoit functions?You can accomplish everything using native AutoIt functions, if you learn what to use and how.taskkill ~ ProcessClosermdir ~ DirRemovetype ~ FileReadfind ~ StringInStr> ~ FileWrite [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Highcommander Posted May 6, 2009 Share Posted May 6, 2009 And I find writing to a batch file pretty silly... heheh I've always been the type of person to get it done how it know to. As an alternative I think it's fine. Although I am glad the original poster now has a solution using Autoit's language Who knows, maybe a year from now someone will read this thread looking for an answer and a batch file subroutine would work well for them *shrug* Link to comment Share on other sites More sharing options...
hottschott Posted May 6, 2009 Author Share Posted May 6, 2009 You can use FileWrite/FileWriteLine/FileInstall to generate the batch file, then run it and delete it. In this sense, you still only need to distribute a single EXE. You can accomplish everything using native AutoIt functions, if you learn what to use and how.taskkill ~ ProcessClosermdir ~ DirRemovetype ~ FileReadfind ~ StringInStr> ~ FileWrite holy crap. Autoit just became THAT much more amazing. I am really taking the long route here huh? haha So where can I go to see a list of native autoit commands, and the comparable batch commands? Thanks again Skruge. Link to comment Share on other sites More sharing options...
BrettF Posted May 6, 2009 Share Posted May 6, 2009 holy crap. Autoit just became THAT much more amazing. I am really taking the long route here huh? haha So where can I go to see a list of native autoit commands, and the comparable batch commands? Thanks again Skruge.The helpfile is your friend. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
hottschott Posted May 6, 2009 Author Share Posted May 6, 2009 The helpfile is your friend.Indeed. Thank you. 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