How to create desktop shortcut
#1
Posted 18 April 2012 - 09:58 PM
Please help and guide me. How to create a desktop shortcut ?
Here is the example:
Since i'm using autorecovery.bat, the autorecovery.bat always being modify. So i had to located it into my USB pendrive. but i want built the autorecovery desktop shortcut inside livexp.iso, the autorecovery desktop shortcut path must point to my USB Pendrive.
How ?
The changes i had to make is at the [Variable] section ?
Thanks a lot.
#2
Posted 18 April 2012 - 11:16 PM
Add_Shortcut,Desktop,,%CDDrive%autorecovery.bat,AutoRecovery
if you are booting from a physical CD/DVD and running autorecovery.bat from a pendrive inserted after the fact then you have a problem. LiveXP cannot possibly guess what drive your pendrive will be mounted at before it has booted, so you really can't make a shortcut ahead of time.
a possible solution is you could write a script using AutoIT or some other language to scan all available drives for autorecovery.bat and then execute it. then use the Add_Shortcut command above to create a shortcut to this "scanner" program.
#3
Posted 19 April 2012 - 12:09 AM
#4
Posted 19 April 2012 - 02:18 AM
There is a method that may work
If your USB drive is always assigned the same drive letter i.e. I:
you can make the shortcut in a VM running your PE with an attached I:
see here for some hints
http://reboot.pro/12297/
See the part about making shortcuts in a VM
If the drive letter will be constantly changing,
there is a more complicated way where you define the CDDrive/USB drive
using a tag file on the USB.
see here:
http://reboot.pro/12297/
See here for how to make the shortcut and compress it with 7-zip
read this section: ######## NOTES #############
http://reboot.pro/12249/
you then just extract the pre-made shortcut during build time
There are plenty of alternatives, albeit some more complicated than others.
If you need more help or explanations, post back here.
Good Luck
RoyM
#5
Posted 20 April 2012 - 03:00 AM
I required create new script ? Can you give me a full example? Thanks. I'm still not really understand it. Thanks a lot for the help
#6
Posted 20 April 2012 - 02:57 PM
are you
A: Booting from a CD and wanting to access autorecovery.bat on a separate pendrive
B: Booting from a pendrive that also has autorecovery.bat on it
C: Something else entirely
I am assuming you are wanting option A?
The following autoit code will scan all removable drives for autorecovery.bat and run it if it finds it.
$aDrives = DriveGetDrive("REMOVABLE") For $i = 1 To $aDrives[0] If FileExists($aDrives[$i] & "autorecovery.bat") Then ShellExecute($aDrives[$i] & "autorecovery.bat") Exit EndIf Next
I compiled the program and upload a script which should help: http://temp.reboot.p...Shortcut.script
This is only one way of doing what you want. see RoyM's post above for other options.
#7
Posted 22 April 2012 - 03:31 PM
if you are booting from the same USB drive that autorecovery.bat is on you can use
Add_Shortcut,Desktop,,%CDDrive%autorecovery.bat,AutoRecovery
if you are booting from a physical CD/DVD and running autorecovery.bat from a pendrive inserted after the fact then you have a problem. LiveXP cannot possibly guess what drive your pendrive will be mounted at before it has booted, so you really can't make a shortcut ahead of time.
a possible solution is you could write a script using AutoIT or some other language to scan all available drives for autorecovery.bat and then execute it. then use the Add_Shortcut command above to create a shortcut to this "scanner" program.
I am attempting this method for my uses but I it is not working. The script is fairly simple:
[main] Title=Diagnostic Tools Shortcuts Description=This script places shortcuts on the desktop for common diagnostic tools Selected=True Level=5 Version=1 [process] Add_Shortcut,Desktop,,%CDDrive%SysinternalsAutorunsAutoruns.exe,Autoruns Add_Shortcut,Desktop,,%CDDrive%SysinternalsProcess ExplorerProcess Explorer.exe,Process Explorer
It didn't work. I'm not sure if I'm missing something in the script. This is booting off a USB drive. Is it not creating the shortcuts because the target files are actually found at %CDDrive%? Any suggestions?
#8
Posted 22 April 2012 - 04:22 PM
[variables] %ProgramTitle%=??? %ProgramEXE%=??? %ProgramFolder%=???
??
Peter
#9
Posted 22 April 2012 - 04:27 PM
Maybe the API needs (inspite unused here):
[variables] %ProgramTitle%=??? %ProgramEXE%=??? %ProgramFolder%=???
??
Peter
Thanks, trying it now. Does the information need to be valid or can I just fill it with fluff?
Thanks!
#10
Posted 22 April 2012 - 05:07 PM
Maybe the glitch depends on something very different. The above post has just been an idea ...
Peter
#11
Posted 22 April 2012 - 05:41 PM
I'm not sure, because I'm not familar about the internals of API. You should write as much real data as possibly.
Maybe the glitch depends on something very different. The above post has just been an idea ...
Peter
Thanks for the input. I attempted it with invalid information with no luck. Since I'm just adding shortcuts for may apps I'm not really sure what to put in the variable section if it is necessary.
#12
Posted 22 April 2012 - 05:51 PM
The values are not used in the shortcuts and therefore irrelevant.
Sorry, That has been a crazy idea.
Peter
#13
Posted 22 April 2012 - 06:01 PM
#14
Posted 22 April 2012 - 06:13 PM
I should clarify, I am creating an ISO and testing it, however i will be extracting the WIM and placing it on a multiboot USB drive, so in it's current working state the targets of the shortcut does not exist. Could this be a problem?
Looks like this was the issue, I added the exe's to the ISO to test and they worked. Thanks for all the help!
#15
Posted 22 April 2012 - 06:33 PM
Peter
#16
Posted 22 April 2012 - 06:48 PM
A small writeup and posting of a working script
would be a welcome addition for others with same problem.
Glad you got it all working.
RoyM
#17
Posted 22 April 2012 - 07:36 PM
@ darkman738
A small writeup and posting of a working script
would be a welcome addition for others with same problem.
Glad you got it all working.
RoyM
My working script is:
[main] Title=Diagnostic Tools Shortcuts Description=This script places shortcuts on the desktop for common diagnostic tools Selected=True Level=5 Version=1 [process] Add_Shortcut,Desktop,,%CDDrive%SysinternalsAutorunsAutoruns.exe,Autoruns Add_Shortcut,Desktop,,%CDDrive%SysinternalsProcess ExplorerProcess Explorer.exe,Process Explorer
The same as I posted before. The reason they were not appearing was that the target files were not there, so the shortcut was dead. I added the files to their appropriate directory and it worked fine.
#18
Posted 23 April 2012 - 01:46 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users