chezy666 Posted July 28, 2004 Posted July 28, 2004 winamp 5.04make sure pskill is in the same folder as winampSet WshShell = WScript.CreateObject("WScript.Shell")WshShell.Run ("C:\winamp\winamp.exe")WScript.Sleep 7000WshShell.SendKeys "%a"WScript.Sleep 500WshShell.SendKeys "{TAB}"WScript.Sleep 500WshShell.SendKeys "{DOWN}"WScript.Sleep 500WshShell.SendKeys "{ }"WScript.Sleep 500WshShell.SendKeys "{DOWN 6}"WScript.Sleep 1000WshShell.SendKeys "{ }"WScript.Sleep 500WshShell.SendKeys "%n"WScript.Sleep 500WshShell.SendKeys "%n"WScript.Sleep 500WshShell.SendKeys "{ }"WScript.Sleep 500WshShell.SendKeys "{DOWN}"WScript.Sleep 500WshShell.SendKeys "{ }"WScript.Sleep 500WshShell.SendKeys "{DOWN}"WScript.Sleep 500WshShell.SendKeys "{ }"WScript.Sleep 500WshShell.SendKeys "{DOWN}"WScript.Sleep 500WshShell.SendKeys "{ }"WScript.Sleep 500WshShell.SendKeys "{DOWN}"WScript.Sleep 500WshShell.SendKeys "{ }"WScript.Sleep 500WshShell.SendKeys "{DOWN}"WScript.Sleep 500WshShell.SendKeys "{ }"WScript.Sleep 500WshShell.SendKeys "{DOWN}"WScript.Sleep 500WshShell.SendKeys "{ }"WScript.Sleep 500WshShell.SendKeys "%n"WScript.Sleep 500WshShell.SendKeys "%n"WScript.Sleep 500WshShell.SendKeys "{ }"WScript.Sleep 500WshShell.SendKeys "i"WScript.Sleep 30000WshShell.SendKeys "{TAB 7}"WScript.Sleep 1000WshShell.SendKeys "{ }"WScript.Sleep 500WshShell.SendKeys "{TAB 2}"WScript.Sleep 500WshShell.SendKeys "{ENTER}"WScript.Sleep 1000WshShell.Run ("C:\winamp\pskill.exe winamp.exe")WScript.Sleep 500Wscript.Quit
mazin Posted August 4, 2004 Posted August 4, 2004 So far, all what I've seen, is installing from hard drive.Example: ("%systemdrive%\Install\MyApp\setup.exe")What if MyApp is on a CD and I want to install it from there directly?I assume it's here: %CDROM%\Install\MyApp\setup.exeHUH?!
prathapml Posted August 5, 2004 Posted August 5, 2004 If your EXE_to_be_run is located at "%CDROM%\install\apps\app.exe", and your .js is located in "%CDROM%\install", you don't need to use any special environment variables. Just use the relative directory paths. For example, in the above example, you can simply run "apps\app.exe /Q" directly.
prathapml Posted August 5, 2004 Posted August 5, 2004 Didn't work in a real test.Now, this is a surprise! The originator of the JS method did not beat it up into doing what he wanted it to do! Here's an explanation:It won't work from svcpack.inf or if you're running it from RunOnceEX/INF method. That is because, the relative directories will work only in context of being run from that folder, whereas the above methods run in a more direct level. It runs fine (atleast for me) if you do the same from either cmdlines/GUIrunonce using .CMDs/XPlode.
mazin Posted August 5, 2004 Posted August 5, 2004 The originator of the JS method did not beat it up into doing what he wanted it to do! hahahaIn fact, I invented an idea to run EXEs via JS or VBS from %CDROM% directly, under any method, RunOnceEX ... CMD ... etc!It's completely MAZIN®'s script. I posted my question just to see if there's an official script to do it.However, I'll post it in Winamp thread when I prepare the text.Thanks, prathapml.
Acheron Posted August 15, 2004 Posted August 15, 2004 Hi, thank you all for your example scripts, now I have made one for Fly 2000 TV:Set WshShell = WScript.CreateObject ("WScript.Shell")WshShell.Run (".\FLY2000TV238B3.exe /S")WScript.Sleep 100WshShell.SendKeys "{ENTER}"WScript.Sleep 1500WshShell.SendKeys "{ENTER}"WScript.Sleep 100WshShell.SendKeys "N"WScript.QuitThis will install Fly 2000 TV 2.38 beta 3 quietly
SibTiger Posted November 14, 2004 Posted November 14, 2004 Here's noob question. How do you include long file names in the script "run" command?Here's what I want to do:WshShell.run "C:\Program Files\My Program\run this file.exe"(I know the 8.3 file name will run this, but is there a way to use the long file names?)
jdoe Posted November 14, 2004 Posted November 14, 2004 Here's noob question. How do you include long file names in the script "run" command?Here's what I want to do:WshShell.run "C:\Program Files\My Program\run this file.exe"(I know the 8.3 file name will run this, but is there a way to use the long file names?)Add quotes = Chr(34)Set WshShell = WScript.CreateObject ("WScript.Shell")WshShell.Run Chr(34) & "C:\Program Files\My Program\run this file.exe" & Chr(34)
BritishBulldog Posted November 14, 2004 Posted November 14, 2004 Has anyone done a vbs script for EasyBoot?
BritishBulldog Posted November 15, 2004 Posted November 15, 2004 is there a way in vbs to tell if a window is still active?need it for an install where files are extracted out of a cab. I could use the sleep command but it is a bit primitive and it will have to be set way over the extraction time just in case it is used on a slower computer. So the best is to wait untill everything is extracted and see if the extraction windows is still open.alsowhat is the time of the sleep functionsay for: WScript.Sleep(200);
gunsmokingman Posted November 15, 2004 Posted November 15, 2004 wscript.sleep 500That how you make it sleep.1000 = 1 second
SibTiger Posted November 23, 2004 Posted November 23, 2004 Someone posted code for watching for a particular window before sending keys. This was a suggested alternative to using "sleep." Seems like a great idea, but I'm not seeing install VBS's that employ this method! Can someone with some coding experience post a sample? Let's suppose this scenario:Run setup.exe to install program: "MyProg"Window pops up with title: "MyProg Installation". Need ALT-N to continue.Window pops up with title: "MyProg File Associations". Need ALT-N to continue.Program installs. Final window title: "MyProg install complete" Need ALT-C to close.I learn by trial and error and by seeing examples. If anyone could post this, I would be very thankful!
BritishBulldog Posted November 23, 2004 Posted November 23, 2004 here it is. This vbs is in the same directory as the setup.exe otherwise the complete path has to be entered. This will check every 2 seconds (sleep 2000) for the window. I have extra sleep of 1000 (1 second) to make sure the windows is completely up.You have to make sure that you have the exact title for the windows you are waiting for. Try AutoIt to get this info. set WshShell = WScript.CreateObject ("WScript.Shell")WshShell.RUN ("setup.exe") Do until WshShell.AppActivate ("MyProg Installation") WScript.Sleep 2000LoopWScript.Sleep 1000WshShell.SendKeys "%{n}"Do until WshShell.AppActivate ("MyProg File Associations") WScript.Sleep 2000LoopWScript.Sleep 1000WshShell.SendKeys "%{n}"Do until WshShell.AppActivate ("MyProg install complete") WScript.Sleep 2000LoopWScript.Sleep 1000WshShell.SendKeys "%{c}"
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now