Sinisterly
Need VB code to add startup entry - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework)
+--- Thread: Need VB code to add startup entry (/Thread-Need-VB-code-to-add-startup-entry)



Need VB code to add startup entry - commander - 02-23-2014

Hello [username],
I dont know vbscript. I have a vbscript with me which runs my batch program hidden. I want this vbscript to add itself to the windows startup so that it will run each time windows starts. I added it to startup manually by copying the vbscript to startup folder (in windows xp). But I want this to be done automatically once the script is executed. It would be great if it worked for both windows xp and windows 7.


This is the script I already have to run my program hidden(without gui):

Code:
Set WinScriptHost = CreateObject("WScript.Shell") WinScriptHost.Run Chr(34) & "C:\start.bat" & Chr(34), 0 Set WinScriptHost = Nothing

Help me please...
Thanks...



Need VB code to add startup entry - commander - 02-23-2014

Hello [username],
I dont know vbscript. I have a vbscript with me which runs my batch program hidden. I want this vbscript to add itself to the windows startup so that it will run each time windows starts. I added it to startup manually by copying the vbscript to startup folder (in windows xp). But I want this to be done automatically once the script is executed. It would be great if it worked for both windows xp and windows 7.


This is the script I already have to run my program hidden(without gui):

Code:
Set WinScriptHost = CreateObject("WScript.Shell") WinScriptHost.Run Chr(34) & "C:\start.bat" & Chr(34), 0 Set WinScriptHost = Nothing

Help me please...
Thanks...



RE: Need VB code to add startup entry, +Rep guarantee - Ex094 - 02-23-2014

This might help http://gallery.technet.microsoft.com/scriptcenter/Script-to-add-an-item-to-2b99b14f
This too http://reboot.pro/topic/16070-win7pe-se-adding-a-vbscript-to-startup-using-addpostconfig/


RE: Need VB code to add startup entry, +Rep guarantee - Ex094 - 02-23-2014

This might help http://gallery.technet.microsoft.com/scriptcenter/Script-to-add-an-item-to-2b99b14f
This too http://reboot.pro/topic/16070-win7pe-se-adding-a-vbscript-to-startup-using-addpostconfig/


RE: Need VB code to add startup entry - Deque - 02-23-2014

Why not just let the script copy itself to the folder?
Don't offer rep for help, please. Read the rules.


RE: Need VB code to add startup entry - Deque - 02-23-2014

Why not just let the script copy itself to the folder?
Don't offer rep for help, please. Read the rules.


RE: Need VB code to add startup entry - commander - 02-24-2014

(02-23-2014, 03:52 PM)Deque Wrote: Why not just let the script copy itself to the folder?
Don't offer rep for help, please. Read the rules.

I already said I dont know vbscript. Thought somebody here will give me a code that can be used to copy the script itself to the startup folder or add a startup entry in the registry.
Sorry for that rep offering.