ajua Posted March 21, 2006 Share Posted March 21, 2006 i want to create some shortcut files but i dont have the programs installed, so there isnt a source file for the shortcut wizard. can this be done? and why?thanks. Link to comment Share on other sites More sharing options...
RogueSpear Posted March 21, 2006 Share Posted March 21, 2006 (edited) Here's a little VBscript for creating a shortcut:On Error Resume NextDim ws, fs, progdir, strPrograms, scut1Set ws = WScript.CreateObject("WScript.Shell")Set fs = CreateObject("Scripting.FileSystemObject")progdir = ws.ExpandEnvironmentStrings ("%PROGRAMFILES%")strPrograms = ws.SpecialFolders("AllUsersPrograms")Set scut1 = ws.CreateShortcut(strPrograms & "\Internet\Windows Messenger.lnk")scut1.TargetPath = (progdir & "\Messenger\Msmsgs.exe")scut1.SaveI've never tried this with the file missing so I can't say for sure if this will work. When I use code similar to this I always put in an IF EXIST. So it may work, it may not. The first line will suppress any error messages. Edited March 21, 2006 by RogueSpear Link to comment Share on other sites More sharing options...
bledd Posted March 21, 2006 Share Posted March 21, 2006 just create them to existing files, then copy all your shortcuts into a 7z file and extract them in your installation Link to comment Share on other sites More sharing options...
RogueSpear Posted March 21, 2006 Share Posted March 21, 2006 just create them to existing files, then copy all your shortcuts into a 7z file and extract them in your installationThis is actually what I do for about 95% of the shortcuts not associated with an installer. Quite a bit easier too. Link to comment Share on other sites More sharing options...
Yzöwl Posted March 21, 2006 Share Posted March 21, 2006 (edited) No, I don't think you've quite got a hold of the actual problem.elajua, appears to have an installed system already, with which they are preparing a new cd source. In this source, they wish to add some software to be installed with the new cd. What they want to do is put some shortcuts into the source cd to be copied over during the install, however the software they are adding to the cd is not installed on their running system. Without a target on the currently running system they cannot create the shortcuts to those targets.Their best choice would be to create the shortcuts during the install, using inf, vbs or a 3rd party utility.Below is a cmd file which will create, run and delete an inf which will create a shortcut to a non-existant file. Run it first, then edit it as you see fit.@ECHO OFF &SETLOCAL ENABLEEXTENSIONSSET "OFile=%TEMP%\_Linx_.inf">%OFile% ECHO [Version]>>%OFile% ECHO Signature = $Windows NT$>>%OFile% ECHO/>>%OFile% ECHO [DefaultInstall]>>%OFile% ECHO UpdateInis = TestLink>>%OFile% ECHO/>>%OFile% ECHO [TestLink]>>%OFile% ECHO setup.ini, progman.groups,, "group0=""%%16400%%\""">>%OFile% ECHO setup.ini, group0,,"""Non-existant File"",""""""%%16422%%\Parent\Child\MadeUp.exe"""""""RUNDLL32 SETUPAPI,InstallHinfSection DefaultInstall 132 %OFile% &&DEL "%OFile%"ENDLOCAL &GOTO :EOF Edited March 21, 2006 by Yzöwl Link to comment Share on other sites More sharing options...
Delprat Posted March 21, 2006 Share Posted March 21, 2006 This tool can create shortcuts to non-existing targets. Link to comment Share on other sites More sharing options...
ajua Posted March 26, 2006 Author Share Posted March 26, 2006 This tool can create shortcuts to non-existing targets.thanks, this will do the work for me.to all other's suggestion will try them if that program doesnt work. the reason i want to make shorcuts without source files is that i do as you say with almost all my software but many freeware appz i use are updated very quickly so sometimes i got them at work i prepare them to use them on my xpcd at home but i dont want to extract/install them at work.thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now