• 0

Batch File to run .VBS on startup


Question

I want to run a xxx.vbs script on startup. How do i make a batch file which will run the .vbs file on startup ( every time i boot into windows)

I just cant add the shortcut to .VBS to startup because I want to run the xx.vbs and give a certain value after it ...

example in the run command i would type

c:\xxx.vbs 1234567890

If i just run the .VBS i will get an error saying cant run without the argument. So i need a batch file which will run

c:\xxx.vbs 1234567890

Link to comment
https://www.neowin.net/forum/topic/438621-batch-file-to-run-vbs-on-startup/
Share on other sites

8 answers to this question

Recommended Posts

  • 0

You could do this:

Create batch file:

startit.bat

@echo off
start c:\xxx.vbs 1234567890

Then create .reg file and merge it to your registry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"My VBS Script"="C:\\my scripts\\startit.bat"

Quick'n'dirty. :)

  • 0
  Wilhelmus said:

You could do this:

Create batch file:

startit.bat

@echo off
start c:\xxx.vbs 1234567890

Then create .reg file and merge it to your registry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"My VBS Script"="C:\\my scripts\\startit.bat"

Quick'n'dirty. :)

Lose the batch file. It's not needed. (Besides, you get a black window as a result of using it)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]

"My VBS Script"="C:\\myscript.vbs"

or

"My VBS Script"="wscript.exe C:\\myscript.vbs"

or place a shortcut to your VBS file in the Startup folder.

  • 0
  On 03/03/2006 at 13:39, Wilhelmus said:

You could do this:

Create batch file:

startit.bat

@echo off
start c:\xxx.vbs 1234567890

Then create .reg file and merge it to your registry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"My VBS Script"="C:\\my scripts\\startit.bat"

Quick'n'dirty?. smile.gif

This was the last key to my puzzle, in which I was trying to use a vbs script to set a default login on a Windows 7 machine on a domain. My script wasn't working via a local GPO but your solution nailed it.

Thanks!

Tom

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

    • No registered users viewing this page.