|
Answer» Hello to all,
I would like to know if it is possible to create a batch file which will create a Desktop Shortcut and a Start Menu Shortcut for a game I am installing. The game is Soldier of Fortune 2. I am doing a CD to DVD conversion of the game. To cut a LONG story short, the DVD asks for CD1 to be inserted near the end of the install, I can cancel the install but choose not to rollback the installation thus leaving the game fully installed except for the Shortcuts I mentioned. I don’t want to go into the full DVD conversion process, but I will if it’s needed. What I basically want to do is maybe use a batch file to create shortcuts to the exe file which starts the game. I am ALREADY using a batch file on the DVD to start the install. I can explain all this in more DETAIL later. FIRSTLY, I would just like to establish if this is remotely possible? OS is XP Pro but I would like to think if it is possible that it could work on all OS’s.
Thanks
EDIT: After searching through the hundreds of messages here I have come to the CONCLUSION I am going to need to use a script. Any help or suggestions are still welcome! I'm not aware of a way to create shortcuts in batch language. This little script will create a shortcut for the desktop:
Code: [Select] set WshShell = WScript.CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") set oShellLink = WshShell.CreateShortcut(strDesktop & "\Notepad.lnk") oShellLink.TargetPath = "c:\windows\system32\notepad.exe" oShellLink.WindowStyle = 1 oShellLink.Hotkey = "Ctrl+Alt+e" oShellLink.IconLocation = "notepad.exe, 0" oShellLink.Description = "Shortcut Script" oShellLink.WorkingDirectory = strDesktop oShellLink.Save
You will need to adjust the parameters to suit your needs. For shortcuts on the start menu check out: The Scripting Guy for some ideas.
Do not mix scripts with batch files (different interpreters) but there is nothing preventing you from calling a script from within a batch file or using the Run method to call a command file from within a script.
Good luck.
|