Jump to content

Shortcut To Desktop


Recommended Posts

Hello,

I made the following script and I get difference in results between the interpreted one with autoit3.exe and the compiled on with aut2exe.exe

I need to change the userprofile var for my app

$LongDesktopName=RegRead('HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders','Desktop')

$DesktopName=StringTrimLeft($LongDesktopName,14)

FileDelete($UserProfile&'\'&$DesktopName&'.lnk')

$result=FileCreateShortcut($olduserprofile&'\'&$DesktopName,$UserProfile&'\'&$DesktopName&'.lnk')

when interpreted,the script create a link to my desktop.

when compiled,i get a link to the Desktop folder in my user account,which is only a part of the desktop.The funny thing is when I edit path(delete double quotes and put them back),the shortcut is then changed to the one to the desktop

Has anybody any idea concerning the problem?

Thanks

Link to comment
Share on other sites

nvm, i just dont see y u are doing a regread to get the desktop path :-/

In fact I need to change the %userprofile% to make a program save his settings where I want.No problems.Then,I would like to create an alias of the desktop in my new %userprofile% to be able to reach it simply with the standard File Dialogs.I do a regread both :

*because I'm french(on my machine,the Desktop directory is called Bureau) and I want my app to run on any windows,so it's the best way to know how the desktop is called

*because I tried to use the @DesktopDir macro without success (I get wrong shortcuts)

Any Idea?

Link to comment
Share on other sites

by the way you do know your doing Regread to get the word Desktop..... ?

$LongDesktopName=RegRead('HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders','Desktop')
$DesktopName=StringTrimLeft($LongDesktopName,14)
msgbox(0,"test",$DesktopName)

Filegetshortname(@desktopdir)

Edited by thatsgreat2345
Link to comment
Share on other sites

  • Moderators

I'm so confused!!

Do you want to create a shortcut to your desktop on your desktop??

Anyway, the suggestions are:

1.

MsgBox(64, 'Info', 'This is your Desktop Directory Location.' & @CR & @DeskTopDir)

2.

MsgBox(64, 'Info', 'This is your Desktop Directory Location in Short Form.' & @CR & FileGetShortName(@DeskTopDir))

Now... you have %UserProfile%, so I'm assuming you actually want:

1.

MsgBox(64, 'Info', 'This is your UserProfile Directory Location.' & @CR & @UserProfileDir)

2.

MsgBox(64, 'Info', 'This is your UserProfile Directory Location in Short Form.' & @CR & FileGetShortName(@UserProfileDir))

Good luck :think:... And welcome to the forums.

Edit:

Typo

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...