macmax Posted March 3, 2006 Share Posted March 3, 2006 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 More sharing options...
0 Wilhelmus Posted March 3, 2006 Share Posted March 3, 2006 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. :) tomrizza 1 Share Link to comment https://www.neowin.net/forum/topic/438621-batch-file-to-run-vbs-on-startup/#findComment-587266058 Share on other sites More sharing options...
0 macmax Posted March 3, 2006 Author Share Posted March 3, 2006 Thanks a lot :) .. That worked perfectly perfect Link to comment https://www.neowin.net/forum/topic/438621-batch-file-to-run-vbs-on-startup/#findComment-587266173 Share on other sites More sharing options...
0 Turge Posted March 3, 2006 Share Posted March 3, 2006 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. Link to comment https://www.neowin.net/forum/topic/438621-batch-file-to-run-vbs-on-startup/#findComment-587266962 Share on other sites More sharing options...
0 JiveMasterT Posted March 3, 2006 Share Posted March 3, 2006 Yeah I'd just make a shortcut to the script and put the arguments in the shortcut properties? That's what I did for my machine because I have to run a uh, vbs file that also gets a string of numbers and letters at startup ;) Link to comment https://www.neowin.net/forum/topic/438621-batch-file-to-run-vbs-on-startup/#findComment-587267007 Share on other sites More sharing options...
0 macmax Posted March 4, 2006 Author Share Posted March 4, 2006 Is there a way i can end the wmiprev.exe process ? which starts after the script is applied at startup ? Link to comment https://www.neowin.net/forum/topic/438621-batch-file-to-run-vbs-on-startup/#findComment-587269272 Share on other sites More sharing options...
0 jake1eye Posted March 4, 2006 Share Posted March 4, 2006 Add this as the last thing in the VBS script Quote CreateObject("Wscript.Shell").run("%comspecill /F /IM wmiprev.exe"),0,true Link to comment https://www.neowin.net/forum/topic/438621-batch-file-to-run-vbs-on-startup/#findComment-587269425 Share on other sites More sharing options...
0 macmax Posted March 4, 2006 Author Share Posted March 4, 2006 This is how the script ends if err <> 0 then WScript.Echo Err.Description, "0x" & Hex(Err.Number) Err.Clear end if Next so where do i add it ? Link to comment https://www.neowin.net/forum/topic/438621-batch-file-to-run-vbs-on-startup/#findComment-587269695 Share on other sites More sharing options...
0 tomrizza Posted June 28, 2012 Share Posted June 28, 2012 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?. 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 Link to comment https://www.neowin.net/forum/topic/438621-batch-file-to-run-vbs-on-startup/#findComment-594964387 Share on other sites More sharing options...
Question
macmax
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