Sign in to follow this  
Followers 0
YGYL

FileCreateShortcut icon path BUG?

6 posts in this topic

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

Share this post


Link to post
Share on other sites



Hey YGYL,

It's not easy to understand what you say :)

Maybe you can ask a friend to translate it to english for you? Or in last resort, post your question in your original language!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

FileCreateShortcut ( "file", "lnk" [, "workdir" [, "args" [, "desc" [, "icon" [, "hotkey" [, icon number [, state]]]]]]] )

"icon" Parameter can not working correctly  Under WIN2012 & WIN8

my computer name is SERVER,when "icon" Parameter is "servershell32.dll"

"servershell32.dll" Will be automatically replace to  %COMPUTERNAME%shell32.dll

on LAN ,Using another WIN8 computer to look (rightClick) this Create lnk file, the "icon" will be error

Edited by YGYL

Share this post


Link to post
Share on other sites

Does it work if you create a shortcut via the manual method and changing the icon too? If the answer is no, then it's not a bug.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

not a bug??

post-35860-0-42994400-1391706066_thumb.p

FileGetShortcut  &  WIN8 Mouse Right Click _r

Icon filename

 

LNK.zip

Edited by YGYL

Share this post


Link to post
Share on other sites

Maybe this was the bug trancexx mentioned a while back in my PasteBin thread.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • rudi
      By rudi
      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.
    • meows
      By meows
      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()