ipstomp Posted January 14, 2008 Share Posted January 14, 2008 Hi everyone, Im new to AutoIT and have become a little stuck with what looks like a simple problem, hopefully someone can help me with it. I am scripting the install and uninstall of some legacy applications, so far I have managed to script the install of the software and that works a treat. My problem comes when I try to uninstall. The path I need to use is :- C:\WINDOWS\system32\Unwise32.exe /a C:\WINDOWS\MO21RT.log Im not sure how to structure this as I have tried :- Run ("C:\WINDOWS\system32\Unwise32.exe /a", "C:\WINDOWS\MO21RT.log") Run ("C:\WINDOWS\system32\Unwise32.exe /a C:\WINDOWS\MO21RT.log") Both have given me errors, so I must be doing something wrong. Any advice would be gratefully received. Cheers John Link to comment Share on other sites More sharing options...
weaponx Posted January 14, 2008 Share Posted January 14, 2008 The first wont work. The second is close. Maybe: Run (@SystemDir & '\Unwise32.exe /a "C:\WINDOWS\MO21RT.log"', @SystemDir) Link to comment Share on other sites More sharing options...
ipstomp Posted January 14, 2008 Author Share Posted January 14, 2008 The first wont work.The second is close. Maybe:Run (@SystemDir & '\Unwise32.exe /a "C:\WINDOWS\MO21RT.log"', @SystemDir)Hi Weaponx,Thanks for your quick reply. I have tried what you have suggested and get the following error :-Line-1Error: Error parsing function call.Could not open MO21RT.logI have included the script below if that helps.CheersJohn-----------------------------------------Run (@SystemDir & '\Unwise32.exe /a "C:\WINDOWS\MO21RT.log"', @SystemDir) WinWait("Remove Shared Component",)ControlClick("Remove Shared Component", "The system indicates that the following shared file is no longer user by any programs and may be deleted.", "Button4")Run (@ProgramFilesDir & '\CAPS\UNIMAP\UNWISE.EXE /a "C:\PROGRA~1\CAPS\UNIMAP\INSTALL.LOG"', @ProgramFilesDir)WinWait("Remove Shared Component",)ControlClick("Remove Shared Component", "The system indicates that the following shared file is no longer user by any programs and may be deleted.", "Button4")------------------------------------------- Link to comment Share on other sites More sharing options...
weaponx Posted January 14, 2008 Share Posted January 14, 2008 Are you sure this file exists? C:\WINDOWS\MO21RT.log Link to comment Share on other sites More sharing options...
Ealric Posted January 14, 2008 Share Posted January 14, 2008 Why do your winwait commands have an appended comma (,) after them? WinWait("Remove Shared Component",) My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic] Link to comment Share on other sites More sharing options...
ipstomp Posted January 14, 2008 Author Share Posted January 14, 2008 Are you sure this file exists? C:\WINDOWS\MO21RT.log Hi Weaponx, Yes the file does exist, I have just tried the second part of the script and that errors the same as it can't find INSTALL.LOG ? [Ealric] Thanks for your message, it was a typo! I have removed them from my script. Cheers John Link to comment Share on other sites More sharing options...
Developers Jos Posted January 14, 2008 Developers Share Posted January 14, 2008 What OS are you running on ? You could try: Run ('"' & @SystemDir & '\Unwise32.exe" /a "C:\WINDOWS\MO21RT.log"', @SystemDir) Jos 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. Link to comment Share on other sites More sharing options...
ipstomp Posted January 14, 2008 Author Share Posted January 14, 2008 (edited) What OS are you running on ?You could try:Run ('"' & @SystemDir & '\Unwise32.exe" /a "C:\WINDOWS\MO21RT.log"', @SystemDir) JosHi Jos,Thanks for your help.The script will be running on Windows 2000 SP4 and Windows XP SP2I have tried this command without any success.But I have made a discovery running the command manually from the windows Run CommandIf the command is structured any differently from C:\WINDOWS\system32\Unwise32.exe /a C:\WINDOWS\MO21RT.log with quotes or anything it errors with not being able to find the .log file.Is there anyway of running this as one?CheersJohn Edited January 14, 2008 by ipstomp Link to comment Share on other sites More sharing options...
SpookMeister Posted January 14, 2008 Share Posted January 14, 2008 Try: Run(@ComSpec & " /c C:\WINDOWS\system32\Unwise32.exe /a C:\WINDOWS\MO21RT.log") [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
ipstomp Posted January 14, 2008 Author Share Posted January 14, 2008 (edited) Try: Run(@ComSpec & " /c C:\WINDOWS\system32\Unwise32.exe /a C:\WINDOWS\MO21RT.log")oÝ÷ Ûú®¢×*h¢CË^8ZK¢¼¨º¸^"¶aÄ®qǬ²+ejéÜë-å'Â+ßg±y©ÝW°'!È+y«Sêk¡¹^z0ËajØv¬pj+_¢»az«¨µ¦¢÷ªÞt*&¦ÞÛ*ºlr·©Ý¬¢{h®éíéÞÆÕ'Â+{¢iÐ,Û-jwl+®*m$±«¢+ÙIÕ¸¡ ½µMÁµÀìÅÕ½Ðì½èÀäÈí]%9=]LÀäÈíÍåÍÑ´ÌÈÀäÈíU¹Ý¥ÍÌȹá½èÀäÈí]%9=]LÀäÈí5 Hopefully this will be something simple to resolve. Thanks to everyone for the help so far. Cheers John Edited January 14, 2008 by ipstomp Link to comment Share on other sites More sharing options...
SpookMeister Posted January 14, 2008 Share Posted January 14, 2008 Throw in some MsgBox's to pause your script after a few commands to try and isolate when it is doing something you are not wanting. As a quick thought though, could it be that "user" is supposed to be "used" in the lines: ControlClick("Remove Shared Component", "The system indicates that the following shared file is no longer user by any programs and may be deleted.", "Button4") [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
ipstomp Posted January 14, 2008 Author Share Posted January 14, 2008 Throw in some MsgBox's to pause your script after a few commands to try and isolate when it is doing something you are not wanting. As a quick thought though, could it be that "user" is supposed to be "used" in the lines: ControlClick("Remove Shared Component", "The system indicates that the following shared file is no longer user by any programs and may be deleted.", "Button4") Hi SpookMeister, Thank you for noticing my typo, that now works really well. Is there a way of stopping the script moving onto the second exe before the first one has finished? Cheers John Link to comment Share on other sites More sharing options...
SpookMeister Posted January 14, 2008 Share Posted January 14, 2008 Maybe: Run(@ComSpec & " /c C:\WINDOWS\system32\Unwise32.exe /a C:\WINDOWS\MO21RT.log") WinWait("Remove Shared Component") ControlClick("Remove Shared Component", "The system indicates that the following shared file is no longer used by any programs and may be deleted.", "Button4") While 1 if Not WinExists("Remove Shared Component") Then ExitLoop Sleep(100) WEnd Run(@ComSpec & " /c C:\PROGRA~1\CAPS\UNIMAP\UNWISE.EXE /a C:\PROGRA~1\CAPS\UNIMAP\INSTALL.LOG") WinWait("Remove Shared Component") ControlClick("Remove Shared Component", "The system indicates that the following shared file is no longer used by any programs and may be deleted.", "Button4") [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] 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