Hello I have multiple .vbs files that create shortcuts for me in my start menu when I install my commandline scanner. What I would like to do is put them all into one .vbs file instead of having multiple files. How can I do this?
Here is an example of one of the files script.
and here is an example of another one of the vbs scripts I want to put into one file with the script above.Code:' Make sure variables are declared. option explicit ' ' Routine to create "mylink.lnk" on the Windows Environment Variable. ' sub CreateShortCut() dim objShell, strEnvironment, objLink set objShell = CreateObject("WScript.Shell") strEnvironment = objShell.ExpandEnvironmentStrings("%USERPROFILE%\Start Menu\Programs\Accessories") set objLink = objShell.CreateShortcut(strEnvironment & "\downIt_LAN.lnk") objLink.Description = "Shortcut to downIt_LAN" objLink.TargetPath = "C:\scanner\Updater\BATS\DownIt_LAN.bat" objLink.WindowStyle = 1 objLink.WorkingDirectory = "C:\scanner\Updater\BATS" objLink.Hotkey = "CTRL+SHIFT+ALT+L" objLink.Description = "This will update the scanner from LAN server." objLink.Save end sub ' Program starts running here. call CreateShortCut()
and finally just incase it is different if more than 2 a third script I want to put in so all 3 of these separated files are all in one script. Is this possible?Code:' Make sure variables are declared. option explicit ' ' Routine to create "mylink.lnk" on the Windows desktop. ' sub CreateShortCut() dim objShell, strEnvironment, objLink set objShell = CreateObject("WScript.Shell") strEnvironment = objShell.ExpandEnvironmentStrings("%USERPROFILE%\Start Menu\Programs\Accessories") set objLink = objShell.CreateShortcut(strEnvironment & "\downIt.lnk") objLink.Description = "Shortcut to downIt" objLink.TargetPath = "C:\scanner\Updater\BATS\downIt.bat" objLink.WindowStyle = 1 objLink.WorkingDirectory = "C:\scanner\Updater\BATS" objLink.Hotkey = "CTRL+SHIFT+ALT+U" objLink.Description = "This will update the scanner from the internet." objLink.Save end sub ' Program starts running here. call CreateShortCut()
Thank you in advance.Code:' Make sure variables are declared. option explicit ' ' Routine to create "mylink.lnk" on the Windows desktop. ' sub CreateShortCut() dim objShell, strEnvironment, objLink set objShell = CreateObject("WScript.Shell") strEnvironment = objShell.ExpandEnvironmentStrings("%USERPROFILE%\Start Menu\Programs\Accessories") set objLink = objShell.CreateShortcut(strEnvironment & "\killAll.lnk") objLink.Description = "Shortcut to killAll" objLink.TargetPath = "C:\killAll.bat" objLink.WindowStyle = 1 objLink.WorkingDirectory = "C:\" objLink.Hotkey = "CTRL+SHIFT+ALT+END" objLink.Description = "This will end the processes of alot." objLink.Save end sub ' Program starts running here. call CreateShortCut()


Reply With Quote