Jump to content

desktop shortcut


Recommended Posts


@rafolb

If you want create a shortcut during Windows 7 unattended install, you can make a batch file or a vbs file.

More help here:

http://ss64.com/nt/shortcut.html

An exemple with a vbs file for notepad in French. Rename the file in vbs.

NotepadShorcut.vbs

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

' CreateShortCut.vbs - Create a Desktop Shortcut.

' VBScript to create .lnk file

' ----------------------------------------------------------'

Option Explicit

Dim objShell, objDesktop, objLink

Dim strAppPath, strWorkDir, strIconPath

' --------------------------------------------------

' Here are the variables that to change if you are making a 'real' script

strWorkDir ="%HOMEDRIVE%%HOMEPATH%"

strAppPath = "%windir%\system32\notepad.exe"

strIconPath = "%windir%\system32\notepad.exe, 0"

Set objShell = CreateObject("WScript.Shell")

objDesktop = objShell.SpecialFolders("Desktop")

Set objLink = objShell.CreateShortcut(objDesktop & "\notepad.lnk")

' ---------------------------------------------------

' Section which adds the shortcut's key properties

objLink.Description = "Créez et modifiez des fichiers texte en utilisant des fonctions de formatage de base."

objLink.HotKey = "CTRL+ALT+X"

objLink.IconLocation = strIconPath

objLink.TargetPath = strAppPath

objLink.WindowStyle = 1

objLink.WorkingDirectory = strWorkDir

objLink.Save

WScript.Quit

' End of creating a desktop shortcut

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

I hope that will help you.

Edited by myselfidem
Link to comment
Share on other sites

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...