MatheFreak Posted February 16, 2009 Share Posted February 16, 2009 (edited) I'm installing and setting up a programm with AutoIt, and it works fine. The only point I still have to do manually is changing the link-file. My link-file (AddonStats.lnk) should get the property 'WorkingDirectory' set to 'D:\Addons\CollectedData'. I have no clue how to set this with AutoIt. I tried VBS-shell but it doesn't work: ; Desktop-Link: ArbeitsDirectory einstellen $Shell = ObjCreate("WScript.Shell") $DesktopPath = $Shell.SpecialFolders("Desktop"); $link = $Shell.openShortcut($DesktopPath & "\AddonStats.lnk") $link.WorkingDirectory = "D:\Addons\CollectedData" $link.Save Error: "The requested action with this object has failed." There is no 'openShortcut' (Only CreateShortcut?) Edited February 16, 2009 by MatheFreak Link to comment Share on other sites More sharing options...
Authenticity Posted February 16, 2009 Share Posted February 16, 2009 Try the GetSpecialFolder method of the object "Scripting.FileSystemObject" although there are plenty AutoIt defined macros that already expose this folders. Search is in the help file under "Macro reference". Link to comment Share on other sites More sharing options...
MatheFreak Posted February 16, 2009 Author Share Posted February 16, 2009 Try the GetSpecialFolder method of the object "Scripting.FileSystemObject"Thanks, but I don't understand the answer, cus my problem is not SpecialFolder.My problem is: How can I open an existing LinkFile and change WorkingDir? Link to comment Share on other sites More sharing options...
Authenticity Posted February 16, 2009 Share Posted February 16, 2009 FileGetShortcut and FileCreateShortcut. You may delete the file first before trying to make the new one although I believe it's not necessary and will overwrite the old one. If it fail then delete it before trying to make the new one. 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