• 0

Add autostart in registry with .vbs file


Question

Hi, I have a .vbs file, when someone clicks on the file it must add itself in the startup of the "HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run"

It should find the path of itself. Is it possible? If it does not, I would like it to point to the desktop.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

It would of been better if you would of posted the script, to see what you have.

To get the path of the vbs script is easy, just add this to your script and use the

varible MyScriptPath to add to the path for the run key.

MyScriptPath = WScript.ScriptFullName
Link to comment
Share on other sites

  • 0

Set WSHShell = WScript.CreateObject("WScript.Shell")
FileName = WScript.ScriptFullName
Directory = WshShell.CurrentDirectory

Set fso = CreateObject("Scripting.FileSystemObject")
Set f2 = fso.GetFile( FileName )

Set wshShell = wscript.CreateObject("WScript.Shell")
f = 1
do
wscript.sleep 100
wshshell.sendkeys "%{f4}"
loop while f=1

Don't click on the file xD

I want that file to autostart every time someone login on the computer.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.