Jump to content

[vbs] when to run


Recommended Posts

Sorry for asking.. I know it was posted before. but I have a hard time finding it.

I made few vbs file using sendkeys for certain things.. like enabling quickstart and some other windows settings.

I have to following batch file starting after installing windows XP:

@echo off
cls

echo Bezig met instellingen 1 moment a.u.b

DEL "%systemroot%\Web\Wallpaper\*.jpg"
DEL "%systemroot%\Web\Wallpaper\*.bmp"

DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programmatoegang en -instellingen.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Windows Update.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Windows-catalogus.lnk"

start /wait %systemdrive%\install\DirectX9b\DirectX9\dxsetup.exe /opk
start /wait %systemdrive%\install\WMP9\MPSetupXP.exe /Q:A /R:N
regedit /s %systemdrive%\install\regtweaks.reg

COPY "%systemdrive%\Install\Tools\psshutdown.exe" "%systemroot%\"

psshutdown.exe -r -t 60 -f -m "De PC zal over 1 minuut opnieuw opstarten"
RD /S /Q %systemdrive%\install

An example of a vbs file I made is:

Set sa = CreateObject("Shell.Application")
sa.ControlPanelItem("desk.cpl")

Wscript.Sleep 2000

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

WshShell.SendKeys "{TAB}"
Wscript.Sleep 200

WshShell.SendKeys "{TAB}"
Wscript.Sleep 200

WshShell.SendKeys "{TAB}"
Wscript.Sleep 200

WshShell.SendKeys "{TAB}"
Wscript.Sleep 200

WshShell.SendKeys "{RIGHT}"
Wscript.Sleep 200

WshShell.SendKeys "{RIGHT}"
Wscript.Sleep 200

WshShell.SendKeys "{RIGHT}"
Wscript.Sleep 200

WshShell.SendKeys "%{e}"
Wscript.Sleep 2000

WshShell.SendKeys " "
Wscript.Sleep 200

WshShell.SendKeys "{TAB}"
Wscript.Sleep 200

WshShell.SendKeys " "
Wscript.Sleep 200

WshShell.SendKeys "{ENTER}"
Wscript.Sleep 200

WshShell.SendKeys "{ENTER}"
Wscript.Sleep 200

I rather have it done before rebooting the system.. any ideas? I know the best way to start them is:

wscript file.vbs //B //NoLogo

Link to comment
Share on other sites


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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...