infoteklink Posted October 15, 2004 Share Posted October 15, 2004 Ok, I've written scripts using autoit many times. Although they have been pretty basic scripts, I understand how it works. All I want the latest script I'm writing to do is open up the services.msc in the system 32 folder in xp pro. Here is what I have: Opt("MouseCoordMode", 0) Run ("C:\WINDOWS\system32\services.msc") I keep getting the following "error: Unable to execute the external program" I can go to the system32 folder and double click on the services.msc and it will open, but the script will not. Any ideas on how to make it open? Thanks Link to comment Share on other sites More sharing options...
infoteklink Posted October 15, 2004 Author Share Posted October 15, 2004 Oh and by the way I just realized that the .msc will not work with the run command because it is not an .exe, .bat, .com, or .pdf format. So what command or workaround do I use to run the .msc? Link to comment Share on other sites More sharing options...
SlimShady Posted October 15, 2004 Share Posted October 15, 2004 This is the best way: Run("mmc services.msc", @SystemDir) Link to comment Share on other sites More sharing options...
silvanr Posted October 15, 2004 Share Posted October 15, 2004 Hi You can only run (EXE, BAT, COM, or PIF), but not .msc Try that: $File = @SystemDir & "\services.msc" Run(@SystemDir & "\mmc.exe " & $File) Sorry, which my English is so bad. I come from Switzerland ;-) Link to comment Share on other sites More sharing options...
MHz Posted October 15, 2004 Share Posted October 15, 2004 run(@comspec & ' /c ' & @systemdir & '\services.msc', '', SW_HIDE) This should work. Link to comment Share on other sites More sharing options...
infoteklink Posted October 15, 2004 Author Share Posted October 15, 2004 Oh and by the way I just realized that the .msc will not work with the run command because it is not an .exe, .bat, .com, or .pdf format. So what command or workaround do I use to run the .msc?<{POST_SNAPBACK}>Thanks Slim, it worked like a charm. I just learned something.Much appreciated! Link to comment Share on other sites More sharing options...
infoteklink Posted October 15, 2004 Author Share Posted October 15, 2004 Another question. How can you start and stop services using autoit. I want to be able to start and stop the "Wireless Zero Configuration" at different times. How do it do that with the script? Thanks Link to comment Share on other sites More sharing options...
SlimShady Posted October 15, 2004 Share Posted October 15, 2004 Check out this topic Link to comment Share on other sites More sharing options...
Developers Jos Posted October 15, 2004 Developers Share Posted October 15, 2004 Another question. How can you start and stop services using autoit. I want to be able to start and stop the "Wireless Zero Configuration" at different times. How do it do that with the script?Thanks<{POST_SNAPBACK}>- Or - do an old fashion "Net Start/Stop" command with runwait. 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...
infoteklink Posted October 15, 2004 Author Share Posted October 15, 2004 - Or - do an old fashion "Net Start/Stop" command with runwait.<{POST_SNAPBACK}>Sweet! It worked like a charm. The command I used is as follows:RunWait(@ComSpec & " /C " & "net start wzcsvc")Thanks JdeB! Link to comment Share on other sites More sharing options...
Guest lemacks Posted December 25, 2004 Share Posted December 25, 2004 Thanks Slim, it worked like a charm. I just learned something.Much appreciated!<{POST_SNAPBACK}>I am new to scripting and saw from the posts what the problem is but am unsure how to solve it. I have converted a script using autoit and it should open a windows media player playlist and a photo album. I get an error when the converted script trys to open the playlist (.wpl) file. The script I created works fine. Does anyone know how to get this program to open the playlist? Here is what I have so far:call "C:\Documents and Settings\mike admin\My Documents\newdvd\test.wpl" | call "d:\Ezphoto\EZPHOTO.EXE"thanks in advancemike Link to comment Share on other sites More sharing options...
Developers Jos Posted December 25, 2004 Developers Share Posted December 25, 2004 I am new to scripting and saw from the posts what the problem is but am unsure how to solve it. I have converted a script using autoit and it should open a windows media player playlist and a photo album. I get an error when the converted script trys to open the playlist (.wpl) file. The script I created works fine. Does anyone know how to get this program to open the playlist? Here is what I have so far:call "C:\Documents and Settings\mike admin\My Documents\newdvd\test.wpl" | call "d:\Ezphoto\EZPHOTO.EXE"thanks in advancemike<{POST_SNAPBACK}>you could try:Run(@comspec & ' /c Start "C:\Documents and Settings\mike admin\My Documents\newdvd\test.wpl"') 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...
Guest lemacks Posted December 25, 2004 Share Posted December 25, 2004 you could try:Run(@comspec & ' /c Start "C:\Documents and Settings\mike admin\My Documents\newdvd\test.wpl"')<{POST_SNAPBACK}>this opens a cmd window and puts me in the newdvd dir where I can type test.wpl and it works. I tried adding @ehco test.wpl. I think this is a start. I still welcome any other tips and help. thanks JdeB Link to comment Share on other sites More sharing options...
Developers Jos Posted December 25, 2004 Developers Share Posted December 25, 2004 this opens a cmd window and puts me in the newdvd dir where I can type test.wpl and it works. I tried adding @ehco test.wpl. I think this is a start. I still welcome any other tips and help. thanks JdeB<{POST_SNAPBACK}>do you have your program associated with the WPL extension ? (in other words ...when you double click it in windows explorer, does it open with the correct program?) 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...
Guest lemacks Posted December 26, 2004 Share Posted December 26, 2004 (edited) do you have your program associated with the WPL extension ? (in other words ...when you double click it in windows explorer, does it open with the correct program?)<{POST_SNAPBACK}>Yes it opens fine. .WPL is a windows media player playlist.Also, when I try to run a .bat file everything works fine but I can't use sendkeys from dos (as far as I know). This is what brings me to autoit.I have gtten autoit to en the 2 programs and send desired keys, but 1 problems exists:1) The window I send keys to is not always on top and I am not sure if I have the usage os @SW_SHOW to bring the right window to the front. could someone check this to make sure it loks good?Here is what I have so far:Run("C:\Program Files\Windows Media Player\wmplayer.exe", "")Sleep ( 6000 )WinSetState ("Windows Media Player","",@SW_SHOW)send("!f")sleep ( 1000 )send("o")sleep ( 1000 )send("d:\test.wpl")sleep ( 2000 )send("{ENTER}")sleep ( 1000 )Run("D:\Ezphoto\EZPHOTO.EXE", "")Sleep ( 6000 )WinSetState ("slideshow8","",@SW_SHOW)sleep ( 1000 )send("!f")sleep ( 1000 )send("p")sleep ( 5000 )For $i = 150 to 1 Step -5 sleep ( 5000 ) send("{RIGHT}")Nextsend("{ESC}")WinSetState ("slideshow6","",@SW_SHOW)sleep ( 1000 )send("!f")sleep ( 1000 )send("p")sleep ( 5000 )For $i = 4745000 to 1 Step -5 sleep ( 5000 ) send("{RIGHT}")Nextsend("{ESC}")WinSetState ("slideshow5","",@SW_SHOW)sleep ( 1000 )send("!f")sleep ( 1000 )send("p")sleep ( 5000 )For $i = 4580000 to 1 Step -5 sleep ( 5000 ) send("{RIGHT}")Nextsend("{ESC}")WinSetState ("slideshow4","",@SW_SHOW)sleep ( 1000 )send("!f")sleep ( 1000 )send("p")sleep ( 5000 )For $i = 2330000 to 1 Step -5 sleep ( 5000 ) send("{RIGHT}")Nextsend("{ESC}")WinSetState ("slideshow3","",@SW_SHOW)sleep ( 1000 )send("!f")sleep ( 1000 )send("p")sleep ( 5000 )For $i = 4910000 to 1 Step -5 sleep ( 5000 ) send("{RIGHT}")Nextsend("{ESC}")WinSetState ("slideshow2","",@SW_SHOW)sleep ( 1000 )send("!f")sleep ( 1000 )send("p")sleep ( 5000 )For $i = 4785000 to 1 Step -5 sleep ( 5000 ) send("{RIGHT}")Nextsend("{ESC}")WinSetState ("slideshow1","",@SW_SHOW)sleep ( 1000 )send("!f")sleep ( 1000 )send("p")sleep ( 5000 )For $i = 4590000 to 1 Step -5 sleep ( 5000 ) send("{RIGHT}")Nextsend("{ESC}");close all windows opened by programexitthanks for your help once again. Edited December 27, 2004 by lemacks 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