hamohd70 Posted December 30, 2005 Share Posted December 30, 2005 during the RunOnceEx.cmd i try to copy some shortcuts to quick launch folder so that they will appear in the quick launck after reboot ..but it fails !!i use a cmd file to do the copy.when i try it on my development PC it works fine but will always fail when i run in during my RunOnceEx.cmd. can anyone help? Link to comment Share on other sites More sharing options...
druiddk Posted December 30, 2005 Share Posted December 30, 2005 (edited) A good idea is to post your script I copy in the QuickLaunch shortcuts during cmdlines.txt:rem Kopier genveje til QuickLaunchcall md "%AllUsersProfile%\..\Default User\Application Data\Microsoft\Internet Explorer\Quick Launch\"call copy /Y "%systemdrive%\install\applications\quicklaunch\*.lnk" "%AllUsersProfile%\..\Default User\Application Data\Microsoft\Internet Explorer\Quick Launch\" Edited December 30, 2005 by druiddk Link to comment Share on other sites More sharing options...
hamohd70 Posted December 31, 2005 Author Share Posted December 31, 2005 (edited) the code is as follows:copy Picasa2.lnk "%AppData%\Microsoft\Internet Explorer\Quick Launch\"after installing the app i copy the shortcut during the RunOnceEx.cmd as i said. Edited December 31, 2005 by hamohd70 Link to comment Share on other sites More sharing options...
glent Posted December 31, 2005 Share Posted December 31, 2005 heres a one I use this may help. This copy the windows explorer shortcut set UserQL=%UserProfile%\Application Data\Microsoft\Internet Explorer\Quick LaunchREM ::::::::::::::::::::::::REM :::: Quick Launch :::REM ::::::::::::::::::::::::REM :: Create / Copy New Shortcuts ::COPY /Y "%%UserProfile%\Start Menu\Programs%\Accessories\Windows Explorer.lnk" "%UserQL%" Link to comment Share on other sites More sharing options...
druiddk Posted December 31, 2005 Share Posted December 31, 2005 If you open a command prompt andcd %AppData%\Microsoft\Internet Explorer\Quick Launch\dirDo you then see the shortcut there?Can you see the QuickLaunch bar before copying the shortcut?@Glent: Why do you use %UserProfile% instead of skipping directly to %AppData%? Link to comment Share on other sites More sharing options...
hamohd70 Posted December 31, 2005 Author Share Posted December 31, 2005 i created an sfx with the same code and works fine.all other still wont work..this code will always work as long as it is not in ran at startup.i pause the cmd file and found that the error was:the path c:\document was not found Link to comment Share on other sites More sharing options...
druiddk Posted December 31, 2005 Share Posted December 31, 2005 (edited) @hamohd70:Ahh... when you specify paths with spaces in for example:c:\documents and settings\blah\blahThen you need to use " " to avoid the spaces:"c:\documents and settings\blah\blah" Edited December 31, 2005 by druiddk Link to comment Share on other sites More sharing options...
hamohd70 Posted December 31, 2005 Author Share Posted December 31, 2005 i used quotes but no use copy Picasa2.lnk "%AppData%\Microsoft\Internet Explorer\Quick Launch\" Link to comment Share on other sites More sharing options...
Yzöwl Posted December 31, 2005 Share Posted December 31, 2005 (edited) If sounds as if you are not running the batch file from the same directory as the location of the .lnk file. In the case of the self-extracting EXE method you say works, the code will be running from the same location.Either CD to that location first or PUSHD and POPDoruse the full pathCOPY X:\PATH_TO\Picasa2.lnk "%AppData%\Microsoft\Internet Explorer\Quick Launch" Edited December 31, 2005 by Yzöwl Link to comment Share on other sites More sharing options...
hamohd70 Posted January 1, 2006 Author Share Posted January 1, 2006 Yzöwl:shortcut and cmd file are both in the same path ! Link to comment Share on other sites More sharing options...
gunsmokingman Posted January 1, 2006 Share Posted January 1, 2006 (edited) Here is a example vbs script that copies to the quick launch.1:\ Make A Text File 2:\ Copies The Text File To Quick Launch3:\ Checks To See if It Copy to Quick Launch4:\ Run The Made Text File If It Found If Not Found A Message Box Will Appear.5:\ It Then Check For The Text Files Thendelets the text files.Save This As WHATEVER_YOU_WANT.VBSDim Fso, QL, Ts '''' VARIBLES FOR THE SCRIPTQL = CreateObject("Wscript.shell").ExpandEnvironmentStrings("%Appdata%\Microsoft\Internet Explorer\Quick Launch\")Set Fso = CreateObject("Scripting.FileSystemObject")Set Ts = Fso.CreateTextFile("ScriptLog.txt")Ts.WriteLine Time() & " < ----- Time and date ----- > " & Date() & vbcrlf & " < ----- Start The Copy ----- > " Ts.WriteLine (CreateObject("Wscript.shell").CurrentDirectory) & Vbcrlf & " < ----- End Of The Copy ----- > " & vbCrLf & QL Ts.Close ''''FILE TO COPY '''' WHERE THE FILE GOES TOFso.CopyFile ("ScriptLog.txt") , (QL), OverwriteExisting'''' THIS LINE TO SEE IF THE COPY MADE IT TO THE QUICK LAUNCHIf Fso.FileExists(QL & "ScriptLog.txt") ThenCreateObject("Wscript.shell").Run(Chr(34) & QL & "ScriptLog.txt" & Chr(34)),Normal,TrueElse '''' ERROR CONTROL IF THE FILE IS NOT FOUNDCreateObject("Wscript.shell").Popup "The Text File Was Not Made Or" & vbCrLf & "Was Not Found At This Location" &_vbCrLf & UCase(CreateObject("Wscript.shell").CurrentDirectory), 15,"Error No File Found....", 0 + 48End IF''''CHECKS THEN DELETE THE TEST FILESIf Fso.FileExists("ScriptLog.txt") Then Fso.DeleteFile("ScriptLog.txt") End IfIf Fso.FileExists(QL & "ScriptLog.txt") Then Fso.DeleteFile(QL & "ScriptLog.txt") End If Here Is A 2 Line VBS File That Copies To The Quick LaunchThen It Deletes The Source Files.Save File As COPY_WHATEVER.VBSThis Text Color Is The Name Of File To Copy ReplaceWith Your File Name. This Is Set To Run In The Same Directory. YouCan Add A Full Path to The file Also Exaple C:\Install\MyShortcuts\Name_Of_FileOn Error Resume Next : Const OverwriteExisting = True, Normal = 1 : Dim Fso, QL, Ts : QL = CreateObject("Wscript.shell").ExpandEnvironmentStrings("%Appdata%\Microsoft\Internet Explorer\Quick Launch\")Set Fso = CreateObject("Scripting.FileSystemObject") : Fso.CopyFile ("TestScript.txt") , (QL), OverwriteExisting : If Fso.FileExists("TestScript.txt") Then Fso.DeleteFile("TestScript.txt")End If Edited January 1, 2006 by gunsmokingman Link to comment Share on other sites More sharing options...
blinkdt Posted January 1, 2006 Share Posted January 1, 2006 shortcut and cmd file are both in the same path !Doesn't matter. As Yzowl stated and druiddk demonstrated, you need the full path on both ends, to locate the source and destination. From my WPI:SET shortcuts=%cdrom%\Programs\00ShortcutsCOPY "%shortcuts%\Windows Explorer.lnk" "%systemdrive%\Documents and Settings\USER_HERE\Application Data\Microsoft\Internet Explorer\Quick Launch"And, yeah, the path could be shorter. Link to comment Share on other sites More sharing options...
hamohd70 Posted January 1, 2006 Author Share Posted January 1, 2006 thankx to all of you for helping me. Link to comment Share on other sites More sharing options...
FrankE9999 Posted January 1, 2006 Share Posted January 1, 2006 I usually create the shortcuts when I install an application so I'm not sure if this is going to do what you want to. There is a program shortcut.exe which lets you create shortcuts from the command line. Note this program will create shortcuts even if the destination file doesn't exist so it can be used to create shortcuts before an application is installed.Example: script that installed autoruns (www.sysinternals.com) and creates a shortcut.@echo offset dest=%~1if "%dest%"=="" set dest=C:\Program Files\Admin\SysInternals\autorunsif not exist "%dest%" md "%dest%"unzip -o "%~dp0autoruns.zip" -d "%dest%"if not exist "%ALLUSERSPROFILE%\Start Menu\Programs\Admin\SysInternals" md "%ALLUSERSPROFILE%\Start Menu\Programs\Admin\SysInternals""%~dp0..\shortcut.exe" /F:"%ALLUSERSPROFILE%\Start Menu\Programs\Admin\SysInternals\Autoruns.lnk" /A:C /T:"%dest%\autoruns.exe" /W:"%dest%"If the example above shortcut.exe is located in the parent folder. You could put it in your $OEM$\$$\System32 folder and then call it directly. The program also uses unzip.exe which is part of unz552xN.exe. I use this command so much that I've included it in my $OEM$\$$\System32 so I know it will always be available.The example script is fairly simple. I want to be able to specify where to uncompress the archive but have a default if I don't specify the path. %~1 is the first parameter passed to the script with the surrounding quotes removed. %~dp0 expands to the path of the batchfile. To create a shortcut on the Quick Launch bar use the following (assuming that shortcut.exe is in you path)shortcut.exe /F:"%APPDATA%\Microsoft\Internet Explorer\Quick Launch\Autoruns.lnk" /A:C /T:"%dest%\autoruns.exe" /W:"%dest%" Link to comment Share on other sites More sharing options...
Powerhouse Posted January 1, 2006 Share Posted January 1, 2006 Instead of having a batch file run during Runonceex.cmd, how about just copying the icon shortcuts to the following folder...Unattended CD Location\$OEM$\$Docs\Default User\Application Data\Microsoft\Internet Explorer\Quick LaunchI put all my quicklanuch icons there, works everytime. 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