Jump to content











Photo
- - - - -

How to create desktop shortcut


  • Please log in to reply
17 replies to this topic

#1 ccl

ccl

    Member

  • Members
  • 47 posts
  •  
    Malaysia

Posted 18 April 2012 - 09:58 PM

Dear all,

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 homes32

homes32

    Gold Member

  • .script developer
  • 1035 posts
  • Location:Minnesota
  •  
    United States

Posted 18 April 2012 - 11:16 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.

#3 ccl

ccl

    Member

  • Members
  • 47 posts
  •  
    Malaysia

Posted 19 April 2012 - 12:09 AM

Thanks, will try it later.

#4 RoyM

RoyM

    Frequent Member

  • .script developer
  • 420 posts
  • Interests:"Booting and Owning".
  •  
    United States

Posted 19 April 2012 - 02:18 AM

Hi ccl

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 ccl

ccl

    Member

  • Members
  • 47 posts
  •  
    Malaysia

Posted 20 April 2012 - 03:00 AM

Dear home32,

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 homes32

homes32

    Gold Member

  • .script developer
  • 1035 posts
  • Location:Minnesota
  •  
    United States

Posted 20 April 2012 - 02:57 PM

You need to be a bit more clear what your trying to do.

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 darkman738

darkman738

    Frequent Member

  • Advanced user
  • 134 posts
  • Location:MA, US
  •  
    United States

Posted 22 April 2012 - 03:31 PM

I am trying this

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 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 22 April 2012 - 04:22 PM

Maybe the API needs (inspite unused here):

[variables]

%ProgramTitle%=???

%ProgramEXE%=???

%ProgramFolder%=???

??
Peter

#9 darkman738

darkman738

    Frequent Member

  • Advanced user
  • 134 posts
  • Location:MA, US
  •  
    United States

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 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 22 April 2012 - 05:07 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

#11 darkman738

darkman738

    Frequent Member

  • Advanced user
  • 134 posts
  • Location:MA, US
  •  
    United States

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 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 22 April 2012 - 05:51 PM

From your result i'm for 90% sure that the [Variables] section is not the reason for this issue.
The values are not used in the shortcuts and therefore irrelevant.
Sorry, That has been a crazy idea.

Peter

#13 darkman738

darkman738

    Frequent Member

  • Advanced user
  • 134 posts
  • Location:MA, US
  •  
    United States

Posted 22 April 2012 - 06:01 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?

#14 darkman738

darkman738

    Frequent Member

  • Advanced user
  • 134 posts
  • Location:MA, US
  •  
    United States

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 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 22 April 2012 - 06:33 PM

:clap:
Peter

#16 RoyM

RoyM

    Frequent Member

  • .script developer
  • 420 posts
  • Interests:"Booting and Owning".
  •  
    United States

Posted 22 April 2012 - 06:48 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


#17 darkman738

darkman738

    Frequent Member

  • Advanced user
  • 134 posts
  • Location:MA, US
  •  
    United States

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 homes32

homes32

    Gold Member

  • .script developer
  • 1035 posts
  • Location:Minnesota
  •  
    United States

Posted 23 April 2012 - 01:46 AM

:clap: Glad you got it working!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users