Jump to content

Recommended Posts

Posted

can teach me how to put the shortcut, for egzample nero burning rom.lnk on the desktop while the desktop isn't started,maybe it can be done with runonceex.tnx


Posted

You could use a vbs-script, perhaps the following:

-----------------------------------------------------------------------------------

'This Script creates a shortcut to the second argument in location of the first argument(including the shortcut's name)

'The shortcut is set to start with maximized window, the icon is taken from the targetfile

Set WSHShell = WScript.CreateObject("WScript.Shell")

Set fs = WScript.CreateObject("Scripting.FileSystemObject")

set oArgs = Wscript.Arguments

SCutPath = oArgs.item(0) 'The first argument

ProgPath = oArgs.item(1) 'The second argument

SCutPath = wshshell.ExpandEnvironmentStrings(SCutPath) 'Expand environment variables to real path

ProgPath = wshshell.ExpandEnvironmentStrings(ProgPath) 'Expand environment variables to real path

Set scut = WSHShell.CreateShortcut(ScutPath &".lnk")

scut.TargetPath = fs.GetAbsolutePathName(ProgPath)

scut.WorkingDirectory = fs.GetParentFolderName(ProgPath)

scut.IconLocation = ProgPath &",0"

scut.Windowstyle = 3

scut.Save

------------------------------------------------------------------------------------------

you can call it from runonceex.cmd with the shortcutpath and progrmlocation as parameters, in which they are expanded, means that you can use environment variables like %PROGRAMFILES%, %ALLUSERSPROFILE% or %USERPROFILE% in your parameters.

When you save it as $OEM$\$1\Install\cscut.vbs, you can call it from runoceex.cmd like

REG ADD %KEY%\005 /VE /D "Create Shortcut" /f

REG ADD %KEY%\005 /V 1 /D "%systemdrive%\install\cscut.vbs %ALLUSERSPROFILE%\Desktop %PROGRAMFILES%\Nero\Nero.exe" /f

Posted (edited)

You could just create the shortcuts in advance and place them in the $OEM$ folders and they'll be copied automatically.

For example:

\XPCD\$OEM$\$Docs\All Users\Desktop

\XPCD\$OEM$\$Docs\All Users\Start Menu\Programs

You can also use the %ProgramFiles% or other Environment Variables in the shortcuts.

Edited by DigeratiPrime
Posted

I have given examples here of how to do this using inf files and many people here also use a small utility tool named shortcut.exe.

Posted (edited)

I have read the notes and it seems a little to hard for me to understand, but @DigeratiPrime has given me the easyiest way(i think) to create shortcut, just copy the .lnk file to the

\XPCD\$OEM$\$Docs\Administrator\Desktop

I only need to modify the target of the link from

E:\Program Files\Ahead\Nero\nero.exe

to

%ProgramFiles%\Ahead\Nero\nero.exe

this should work, right?

Edited by maniaq

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...