Script to add an item to Startup in Windows 8 (VBScript)

Introduction

This VBScript sample shows how to add an item to the Startup in Windows 8.

Scenarios

Sometimes, users want programs to start when your system starts. Usually, you can add items to the startup folder. In Windows 8, adding items to Startup requires additional work. This script can resolve this problem.

Script

1. Drag one file to the script as shown in the following figure.
 

2. It will show a message box to display execution result.

Here are some code snippets for your references. To get the complete script sample, please click the download button at the beginning of this page.

VB Script
Edit|Remove
SelectCase ArgCount  
        Case1   
            File = WScript.Arguments(0) 
                Set FSO = CreateObject("Scripting.FileSystemObject") 
                    FSO.CopyFile File,UserConfigDestination 
                    If Err.Number = 0Then 
                        WScript.Echo "Add file successfully."Else 
                        WScript.Echo "Please drag a file to this script."EndIfCaseElse  
                WScript.Echo "Please drag a file to this script."EndSelect

Prerequisite

Windows 8

Additional Resources

CreateObject