MSFN Forum: VBS Scripts - MSFN Forum

Jump to content



  • 4 Pages +
  • 1
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • You cannot reply to this topic

VBS Scripts For all the programs you need :D Rate Topic: -----

#41 User is offline   Bâshrat the Sneaky 

  • aka Wim Leers
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,214
  • Joined: 29-October 03
  • OS:none specified
  • Country: Country Flag

Posted 18 February 2004 - 11:46 AM

I wrote one for adding a Language Pack to Nero:

Set WshShell = WScript.CreateObject ("WScript.Shell")
WshShell.Run (".\NBR6302nld.exe")
WScript.Sleep 5000
WshShell.SendKeys "~"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{UP}"
WScript.Sleep 1000
WshShell.SendKeys "~"
WScript.Sleep 1000
WshShell.SendKeys "~"
WScript.Quit



#42 User is offline   mentalindustrie 

  • Junior
  • Pip
  • Group: Members
  • Posts: 65
  • Joined: 03-June 04

Posted 08 June 2004 - 09:57 PM

ok not sure if this is kinda out of place cause its a working script.
but i cant get it to run.

script for Intellitype v5.0

Set WshShell = WScript.CreateObject ("WScript.Shell")
WScript.Sleep 3000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "{n}"
WScript.Sleep 1000
WshShell.SendKeys "{n}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{=}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "{M}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{-}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 20000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{-}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"

(this makes country as new zealand and selects multimedia keyboard)

i suggest u run it once and change those two so it installs for ur contry and keyboard.

but my real problem is i can't get it to run from my auto_install.cmd

ECHO.
ECHO Installing Intellitype
ECHO Please wait...
"%systemdrive%\Install\Applications\Intellitype\ITP5_0Eng\keyboard.vbs"
start /wait "%systemdrive%\Install\Applications\Intellitype\ITP5_0Eng\setup.exe"

there is the code. is my problem the start /wait or can u not run *.vbs from command prompt.

thanks
Mental Industries

#43 User is offline   mentalindustrie 

  • Junior
  • Pip
  • Group: Members
  • Posts: 65
  • Joined: 03-June 04

Posted 08 June 2004 - 10:00 PM

And here is my code for Intellimouse v5.0

Set WshShell = WScript.CreateObject ("WScript.Shell")
WScript.Sleep 3000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "{n}"
WScript.Sleep 1000
WshShell.SendKeys "{n}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{=}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "{w}"
WScript.Sleep 1000
WshShell.SendKeys "{w}"
WScript.Sleep 1000
WshShell.SendKeys "{w}"
WScript.Sleep 1000
WshShell.SendKeys "{w}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{-}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 30000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{-}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"


again i live in New Zealand so change teh two "n" to where u live and i make a wheelmouse optical so again change the four "w" so it highlights what u have.

run it for ur self once taking note on those to pages of your keystrokes.

but like with my keyboard scipt can't get it to run from the command prompt.

But they do both work when run in windows!!!


Thanks
Mental Industries

#44 User is offline   erther 

  • Group: Members
  • Posts: 9
  • Joined: 26-June 04

Posted 05 July 2004 - 07:58 AM

has anybody a script for zonealarm pro to "restore security settings"?? see under overview --> preference...

my little script looks like that:

- open zonealarm.exe
- send 8 times TAB
- and then send 2 times RIGHT <-- but it didn't do this step
- send r
- send path for xml file
- send 2 times ENTER

please help me, i'm going to be crazy... :)

thx!!
erther

#45 User is offline   chezy666 

  • Junior
  • Pip
  • Group: Members
  • Posts: 92
  • Joined: 31-May 04

Posted 27 July 2004 - 11:34 AM

Use %systemdrive% for C:\

scripts for >>>
tune up utilities 2004

Set WshShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next


WshShell.Run ("C:\tu\setup.exe")

WScript.Sleep 7000
WshShell.SendKeys "n"
WScript.Sleep 200
WshShell.SendKeys "a"
WScript.Sleep 200
WshShell.SendKeys "n"
WScript.Sleep 200
WshShell.SendKeys "NAME"
WScript.Sleep 200
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "Company"
WScript.Sleep 200
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "m"
WScript.Sleep 200
WshShell.SendKeys "n"
WScript.Sleep 200
WshShell.SendKeys "n"
WScript.Sleep 200
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{ }"
WScript.Sleep 200
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{ }"
WScript.Sleep 200
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{ }"
WScript.Sleep 200
WshShell.SendKeys "n"
WScript.Sleep 40000
WshShell.SendKeys "f"
WScript.Sleep 200
Wscript.Quit

agnitum latest

Set WshShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next


WshShell.Run ("C:\ao\OUTPOSTPROINSTALL.EXE")

WScript.Sleep 12000
WshShell.SendKeys "n"
WScript.Sleep 2000
WshShell.SendKeys "{TAB 2}"
WScript.Sleep 500
WshShell.SendKeys "{UP}"
WScript.Sleep 500
WshShell.SendKeys "n"
WScript.Sleep 2000
WshShell.SendKeys "n"
WScript.Sleep 500
WshShell.SendKeys "n"
WScript.Sleep 500
WshShell.SendKeys "n"
WScript.Sleep 20000
WshShell.SendKeys "n"
WScript.Sleep 500
WshShell.SendKeys "{TAB 4}"
WScript.Sleep 500
WshShell.SendKeys " "
WScript.Sleep 500
WshShell.SendKeys "n"
WScript.Sleep 500
WshShell.SendKeys "{TAB 4}"
WScript.Sleep 500
WshShell.SendKeys " "
WScript.Sleep 500
WshShell.SendKeys "n"
WScript.Sleep 500
WshShell.SendKeys "f"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500


Wscript.Quit

winamp 5.03C

Set WshShell = WScript.CreateObject("WScript.Shell")



WshShell.Run ("C:\winamp\winamp.exe")

WScript.Sleep 7000
WshShell.SendKeys "%a"
WScript.Sleep 200
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{DOWN}"
WScript.Sleep 200
WshShell.SendKeys "{ }"
WScript.Sleep 200
WshShell.SendKeys "{DOWN 6}"
WScript.Sleep 200
WshShell.SendKeys "%n"
WScript.Sleep 200
WshShell.SendKeys "%n"
WScript.Sleep 200
WshShell.SendKeys "{ }"
WScript.Sleep 200
WshShell.SendKeys "{DOWN}"
WScript.Sleep 200
WshShell.SendKeys "{ }"
WScript.Sleep 200
WshShell.SendKeys "{DOWN}"
WScript.Sleep 200
WshShell.SendKeys "{ }"
WScript.Sleep 200
WshShell.SendKeys "{DOWN}"
WScript.Sleep 200
WshShell.SendKeys "{ }"
WScript.Sleep 200
WshShell.SendKeys "{DOWN}"
WScript.Sleep 200
WshShell.SendKeys "{ }"
WScript.Sleep 200
WshShell.SendKeys "{DOWN}"
WScript.Sleep 200
WshShell.SendKeys "{ }"
WScript.Sleep 200
WshShell.SendKeys "{DOWN}"
WScript.Sleep 200
WshShell.SendKeys "{ }"
WScript.Sleep 200
WshShell.SendKeys "%n"
WScript.Sleep 200
WshShell.SendKeys "%n"
WScript.Sleep 200
WshShell.SendKeys "i"
WScript.Sleep 27000
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{ENTER}"
WScript.Sleep 200
WshShell.Run ("C:\winamp\pskill.exe winamp.exe")
WScript.Sleep 200
Wscript.Quit

make sure pskill is in the same directory

spy sweeper 3

Set WshShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next


WshShell.Run ("C:\ss\ss.exe")

WScript.Sleep 7000
WshShell.SendKeys "n"
WScript.Sleep 200
WshShell.SendKeys "XXXXXXXXXXXXXXXXX"
WScript.Sleep 200
WshShell.SendKeys "n"
WScript.Sleep 200
WshShell.SendKeys "%a"
WScript.Sleep 200
WshShell.SendKeys "%n"
WScript.Sleep 200
WshShell.SendKeys "n"
WScript.Sleep 200
WshShell.SendKeys "i"
WScript.Sleep 20000
WshShell.SendKeys "{ }"
WScript.Sleep 200
WshShell.SendKeys "f"
WScript.Sleep 200


Wscript.Quit

objectdock

Set WshShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next


WshShell.Run ("C:\od\ObjectDock.exe")

WScript.Sleep 7000
WshShell.SendKeys "XXX-XXX-XXX-XXX-XX"
WScript.Sleep 200
WshShell.SendKeys "{TAB}"
WScript.Sleep 200
WshShell.SendKeys "{ENTER}"
WScript.Sleep 200
WshShell.SendKeys "{TAB 2}"
WScript.Sleep 200
WshShell.SendKeys "{UP}"
WScript.Sleep 200
WshShell.SendKeys "n"
WScript.Sleep 200
WshShell.SendKeys "n"
WScript.Sleep 25000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 200

Wscript.Quit


#46 User is offline   chezy666 

  • Junior
  • Pip
  • Group: Members
  • Posts: 92
  • Joined: 31-May 04

Posted 27 July 2004 - 11:49 PM

winamp 5.04
make sure pskill is in the same folder as winamp

Set WshShell = WScript.CreateObject("WScript.Shell")



WshShell.Run ("C:\winamp\winamp.exe")

WScript.Sleep 7000
WshShell.SendKeys "%a"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{DOWN}"
WScript.Sleep 500
WshShell.SendKeys "{ }"
WScript.Sleep 500
WshShell.SendKeys "{DOWN 6}"
WScript.Sleep 1000
WshShell.SendKeys "{ }"
WScript.Sleep 500
WshShell.SendKeys "%n"
WScript.Sleep 500
WshShell.SendKeys "%n"
WScript.Sleep 500
WshShell.SendKeys "{ }"
WScript.Sleep 500
WshShell.SendKeys "{DOWN}"
WScript.Sleep 500
WshShell.SendKeys "{ }"
WScript.Sleep 500
WshShell.SendKeys "{DOWN}"
WScript.Sleep 500
WshShell.SendKeys "{ }"
WScript.Sleep 500
WshShell.SendKeys "{DOWN}"
WScript.Sleep 500
WshShell.SendKeys "{ }"
WScript.Sleep 500
WshShell.SendKeys "{DOWN}"
WScript.Sleep 500
WshShell.SendKeys "{ }"
WScript.Sleep 500
WshShell.SendKeys "{DOWN}"
WScript.Sleep 500
WshShell.SendKeys "{ }"
WScript.Sleep 500
WshShell.SendKeys "{DOWN}"
WScript.Sleep 500
WshShell.SendKeys "{ }"
WScript.Sleep 500
WshShell.SendKeys "%n"
WScript.Sleep 500
WshShell.SendKeys "%n"
WScript.Sleep 500
WshShell.SendKeys "{ }"
WScript.Sleep 500
WshShell.SendKeys "i"
WScript.Sleep 30000
WshShell.SendKeys "{TAB 7}"
WScript.Sleep 1000
WshShell.SendKeys "{ }"
WScript.Sleep 500
WshShell.SendKeys "{TAB 2}"
WScript.Sleep 500
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.Run ("C:\winamp\pskill.exe winamp.exe")
WScript.Sleep 500
Wscript.Quit

#47 User is offline   mazin 

  • MSFN Addict
  • Group: Supreme Sponsor
  • Posts: 1,952
  • Joined: 12-January 04

Posted 04 August 2004 - 05:16 PM

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.exe

HUH?!

#48 User is offline   prathapml 

  • Follow the rules please :-)
  • Group: Patrons
  • Posts: 6,791
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 04 August 2004 - 06:13 PM

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.

#49 User is offline   mazin 

  • MSFN Addict
  • Group: Supreme Sponsor
  • Posts: 1,952
  • Joined: 12-January 04

Posted 04 August 2004 - 06:32 PM

Thanks, prathapml. I'll try it.

#50 User is offline   mazin 

  • MSFN Addict
  • Group: Supreme Sponsor
  • Posts: 1,952
  • Joined: 12-January 04

Posted 05 August 2004 - 03:48 AM

Didn't work in a real test.

#51 User is offline   prathapml 

  • Follow the rules please :-)
  • Group: Patrons
  • Posts: 6,791
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 05 August 2004 - 04:01 AM

Quote

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.

#52 User is offline   mazin 

  • MSFN Addict
  • Group: Supreme Sponsor
  • Posts: 1,952
  • Joined: 12-January 04

Posted 05 August 2004 - 06:32 AM

prathapml, on Aug 5 2004, 01:01 PM, said:

The originator of the JS method did not beat it up into doing what he wanted it to do! :rolleyes:

hahaha

In 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.

#53 User is offline   Acheron 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 915
  • Joined: 28-June 04

  Posted 15 August 2004 - 10:35 AM

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 100
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1500
WshShell.SendKeys "{ENTER}"
WScript.Sleep 100
WshShell.SendKeys "N"
WScript.Quit


This will install Fly 2000 TV 2.38 beta 3 quietly

#54 User is offline   SibTiger 

  • Computer Geek
  • Group: Members
  • Posts: 44
  • Joined: 26-February 04

Posted 13 November 2004 - 07:52 PM

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?)

#55 User is offline   jdoe 

  • Advanced Member
  • PipPipPip
  • Group: Banned
  • Posts: 314
  • Joined: 02-May 04

Posted 14 November 2004 - 03:31 AM

SibTiger, on Nov 13 2004, 08:52 PM, said:

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)



:)

#56 User is offline   BritishBulldog 

  • Member
  • PipPip
  • Group: Members
  • Posts: 271
  • Joined: 11-October 04

Posted 14 November 2004 - 12:14 PM

Has anyone done a vbs script for EasyBoot?

#57 User is offline   BritishBulldog 

  • Member
  • PipPip
  • Group: Members
  • Posts: 271
  • Joined: 11-October 04

Posted 15 November 2004 - 02:58 AM

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.

also
what is the time of the sleep function
say for:

WScript.Sleep(200);

#58 User is offline   gunsmokingman 

  • MSFN Addict
  • Group: Super Moderator
  • Posts: 1,991
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 15 November 2004 - 03:53 AM

wscript.sleep 500
That how you make it sleep.
1000 = 1 second

#59 User is offline   SibTiger 

  • Computer Geek
  • Group: Members
  • Posts: 44
  • Joined: 26-February 04

Posted 22 November 2004 - 11:20 PM

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!

#60 User is offline   BritishBulldog 

  • Member
  • PipPip
  • Group: Members
  • Posts: 271
  • Joined: 11-October 04

Posted 23 November 2004 - 05:35 AM

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 2000
Loop
WScript.Sleep 1000
WshShell.SendKeys "%{n}"

Do until WshShell.AppActivate ("MyProg File Associations")
     WScript.Sleep 2000
Loop
WScript.Sleep 1000
WshShell.SendKeys "%{n}"

Do until WshShell.AppActivate ("MyProg install complete")
     WScript.Sleep 2000
Loop
WScript.Sleep 1000
WshShell.SendKeys "%{c}"


Share this topic:


  • 4 Pages +
  • 1
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy