Search the Community
Showing results for tags 'filecreateshortcut'.
-
when i use WIN2012,my computer name is SERVER FileCreateShortcut(@WindowsDir & "explorer.exe", "1.lnk", @WindowsDir, "/e,c:", "Tooltip description of the shortcut.", "servershell32.dll", "^!t", "15", @SW_MINIMIZE) "servershell32.dll" will be auto change to %COMPUTERNAME%shell32.dll if use Another PC of WIN8 to open this lnkļ¼the LNK ico can't be Correct read
-
Hi, I'm trying to create a shortcut playing with variables but I can't figure out what's wrong I got 2 variables joined in one with for instance Local $path = FileOpenDialog($message, "C:" & "", "Select your executable (*.exe)", 1 + 4) Local $elev = 'c:\windows\System32\cmd.exe /c start "runhigh" /high ' $target = $elev & $path FileCreateShortcut($target, @DesktopCommonDir & "\linked.lnk", StringLeft($target,StringInStr($target,"\",0,-1)) , "" , "" , "c:\i.ico") The problem is that a shortcut is created but instead of the target area I got the start in filled with my variable My second problem is that when I do a shell execute of the result of $target = $elev & $path, Note that if I do a batch with the variable written manually, it's working.
-
Hello. Windows shortcuts have the option to check "Run as administrator" in the "advanced settings" on the tab "Shortcut" Is it possible to use the function FileCreateShortcut() to define this? Or to use this function and modify this option afterwards? Is it possible to "read" this option's current state for a given LNK file? (FileGetShortcut() doesn't seem to offer that?) Regards, Rudi.
-
236 This works perfect for desktop shortcuts $ink = "\cleaner.lnk" $cmd = "C:\AutoIt3\Code\00_Trials\Installer\Cleaner.exe" $icon = "C:\32.ico" ; & "\au3", FileCreateShortcut($cmd , @DesktopDir & $ink , @ScriptDir, "", "Tooltip description of the shortcut.", $icon, @SW_MINIMIZE) This works perfect for the Program Files Menu #include <FileConstants.au3> #include <MsgBoxConstants.au3> $cmd = "C:\AutoIt3\Code\00_Trials\Installer\Cleaner.exe" $icon = "C:\32.ico" $ink = "\cleaner.lnk" FileCreateShortcut($cmd , @ProgramsDir & $ink , @ScriptDir, "", "Tooltip description of the shortcut.", $icon, @SW_MINIMIZE) However this has me so confused and dazed I had to change DishNet to Sirius 60's/70's Motown to chill. My problem is I have confirmed variables for each section of the script but it does not put the variable in the correct place or it ignores it altogether, #include <FileConstants.au3> #include <MsgBoxConstants.au3> Global $ifullpath Global $iicoFile Global $iSoftTitle Global $iincFile Global $incthing ;------------------$cmd = "C:\00test_Installer\00bons1.exe" $cmd = $ifullpath ;------------------$icon = "C:\32.ico" $icon = $iicoFile ;----------------------------$ink = "\file.ini" $ink = $incthing ;------------------------- $iSoftTitle = \SoftTitle.ini $Tooltip = $iSoftTitle IniRead(@ScriptDir & "\SoftTitle.ini", "General", ".", $iSoftTitle) Local $iSoftTitle = IniRead(@ScriptDir & "\SoftTitle.ini", "General", ".", "") MsgBox(4096,"$iSoftTitle", $iSoftTitle) ; Retrieve the system environment variable called %PATH%. Local $sEnvVar = EnvGet("PATH") ; Assign the system environment variable called %PATH% with its current value as well as the script directory. ; When you assign an environment variable you do so minus the percentage signs (%). EnvSet("PATH", $sEnvVar & ";" & @ScriptDir) ; Refresh the OS environment for changes to take affect. EnvUpdate() IniRead(@ScriptDir & "\fullpath.ini", "General", ".", $ifullpath) Local $ifullpath = IniRead(@ScriptDir & "\fullpath.ini", "General", ".", "") MsgBox(4096,"$ifullpath", $ifullpath) Local $sEnvVar = EnvGet("PATH") ; Assign the system environment variable called %PATH% with its current value as well as the script directory. ; When you assign an environment variable you do so minus the percentage signs (%). EnvSet("PATH", $sEnvVar & ";" & @ScriptDir) ; Refresh the OS environment for changes to take affect. EnvUpdate() IniRead(@ScriptDir & "\icoFile.ini", "General", ".", $iicoFile) Local $iicoFile = IniRead(@ScriptDir & "\icoFile.ini", "General", ".", "") MsgBox(4096,"$iicoFile", $iicoFile) Local $sEnvVar = EnvGet("PATH") ; Assign the system environment variable called %PATH% with its current value as well as the script directory. ; When you assign an environment variable you do so minus the percentage signs (%). EnvSet("PATH", $sEnvVar & ";" & @ScriptDir) ; Refresh the OS environment for changes to take affect. EnvUpdate() IniRead(@ScriptDir & "\File.ini", "General", ".", $iincFile) Local $iincFile = IniRead(@ScriptDir & "\File.ini", "General", ".", "") MsgBox(4096,"$iincFile", $iincFile) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"\" & $iincFile &".ink" = $incthing $incthing=("\" & $iincFile &".ink") MsgBox(4096,"$incthing", $incthing) FileCreateShortcut($cmd , @ProgramsDir & $ink , @ScriptDir, "", $Tooltip, $icon, @SW_MINIMIZE) This does make a programfiles menu item The target is Computer and not the var $Cmd The start in is the correct directory It added a shortcut key! that I did not add It ignored the comment altogether and that is empty and the wrong icon. Are there different rules if you use a variable instead of a text string? Thanks for looking. Oh yes I almost forgot, I use this fancy piece of code I found in the forums one day that really saved me. I could not get things straight bouncing between things and put this in and all of a sudden the path I wanted was there, I do apologize as I do not remember who posted it Local $sEnvVar = EnvGet("PATH") ; Assign the system environment variable called %PATH% with its current value as well as the script directory. ; When you assign an environment variable you do so minus the percentage signs (%). EnvSet("PATH", $sEnvVar & ";" & @ScriptDir) ; Refresh the OS environment for changes to take affect. EnvUpdate()
- 2 replies
-
- Shortcut
- CreateShortcut
-
(and 2 more)
Tagged with: