mr-es335 Posted August 23 Share Posted August 23 Good day, The following snippet does work... Local $_fpath1 = "G:\Session_Master\Show" Local $_fpath2 = "E:\Desktop\Show" ;------------------ FileCreateShortcut($_fpath1, $_fpath2) A shortcut named "Show.lnk" to "G:\Session_Master\Show" is created on the Desktop name "Show.lnk"! The following snippet does not work... Local $_fpath1 = "G:\Test_Master" Local $_fpath2 = "D:\Install\App_Config\Digital_Audio\6_Testing\Data\Test_Master ;------------------ FileCreateShortcut($_fpath1, $_fpath2) A shortcut named "Test_Master.lnk" to "G:\Test_Master" IS created....however, the shortcut is created in the "Data" folder!! Why?? Any assistance in this matter would be greatly appreciated...as always!! mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
ioa747 Posted August 23 Share Posted August 23 Local $_filePath = @ScriptFullPath Local $_Linkpath = @ScriptDir & "\MyShortCut.lnk" ;------------------ FileCreateShortcut($_filePath, $_Linkpath) I know that I know nothing Link to comment Share on other sites More sharing options...
mr-es335 Posted August 23 Author Share Posted August 23 ioa747, First, thanks for the reply...appreciated...again...as always!! Second, why is it that in the first example, I am not required to provide a name for the shortcut? • Thus, is the shortcut always required? • I would assume then, that if the HelpFile notes such, that such is required? From HelpFile: "lnk - Full path and file name of the shortcut" mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
ioa747 Posted August 23 Share Posted August 23 (edited) From HelpFile: look at the example Edit: with "D:\Install\App_Config\Digital_Audio\6_Testing\Data\Test_Master" You give the path but not the name and it thinks the name is Test_Master and puts it in the Data folder Edited August 23 by ioa747 mr-es335 1 I know that I know nothing Link to comment Share on other sites More sharing options...
Solution ioa747 Posted August 23 Solution Share Posted August 23 (edited) #include <StringConstants.au3> Local $_fpath1 = "G:\Test_Master" Local $_fpath2 = "D:\Install\App_Config\Digital_Audio\6_Testing\Data\Test_Master" MakeShortcut($_fpath1, $_fpath2) ;---------------------------------------------------------------------------------------- Func MakeShortcut($_filePath, $_Linkpath) Local $sName = StringTrimLeft($_filePath, StringInStr($_filePath, "\", $STR_NOCASESENSEBASIC, -1)) ConsoleWrite("$sName=" & $sName & @CRLF) FileCreateShortcut($_filePath, $_Linkpath & "\" & $sName & ".lnk") EndFunc ;==>MakeShortcut ;---------------------------------------------------------------------------------------- Edited August 24 by ioa747 I added & ".lnk" I know that I know nothing Link to comment Share on other sites More sharing options...
mr-es335 Posted August 23 Author Share Posted August 23 ioa747, Got it!!! Then again, "Why does this work?" Local $_fpath1 = "G:\Session_Master\Show" Local $_fpath2 = "E:\Desktop\Show" ;------------------ FileCreateShortcut($_fpath1, $_fpath2) I am providing no actual name for the shortcut? mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
ioa747 Posted August 24 Share Posted August 24 12 hours ago, mr-es335 said: The following snippet does work... Local $_fpath1 = "G:\Session_Master\Show" Local $_fpath2 = "E:\Desktop\Show" ;------------------ FileCreateShortcut($_fpath1, $_fpath2) A shortcut named "Show.lnk" to "G:\Session_Master\Show" is created on the Desktop name "Show.lnk"! it's the same behavior with "E:\Desktop\Show" You give the path but not the name and it thinks the name is Show and puts it in the Desktop folder otherwise it should put it in the E:\Desktop\Show folder I know that I know nothing Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now