Sign in to follow this  
Followers 0
MatheFreak

Propertys of Link-File

4 posts in this topic

#1 ·  Posted (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 by MatheFreak

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

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