Jump to content

Recommended Posts

Posted

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

Posted

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?

Posted (edited)

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
  • Moderators
Posted (edited)

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.

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
×
×
  • Create New...