Crazy Gamer231
Crazy Gamer231

Reputation: 23

Make VbScript run as soon as you open get on computer after log off or restart

Ok. So, I made this thing in vbs that says a little password when you log on. I am trying to make it say it as soon as you log on (if possible) because at the moment I have to click. I tried this script that someone suggested:

Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "notepad.exe c:\LOGON.vbs"

But that did not seem to work. So, thanks for your help!

Upvotes: 2

Views: 643

Answers (1)

Douglas Reid
Douglas Reid

Reputation: 3788

One of these options might work for you...

  1. Place the vbs file (or a shortcut) in your startup folder. E.g. C:\Documents and Settings\%UserName%\Start Menu\Programs\Startup

or

  1. Use Task Scheduler to define a task that is triggered 'when the computer starts' or 'when I log on' as described here. For a more programmatic approach there is a C++ API for task scheduler.

or

  1. Add the path to the vbs file to the registry depending on whether you want to run...

for all users:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.

or a current user

HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Upvotes: 2

Related Questions