guigz Posted May 1, 2006 Share Posted May 1, 2006 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 More sharing options...
Thatsgreat2345 Posted May 1, 2006 Share Posted May 1, 2006 (edited) nvm, i just dont see y u are doing a regread to get the desktop path :-/ Edited May 1, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
guigz Posted May 1, 2006 Author Share Posted May 1, 2006 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 More sharing options...
Thatsgreat2345 Posted May 1, 2006 Share Posted May 1, 2006 have you tryed filegetlongname(@desktopdir) Link to comment Share on other sites More sharing options...
guigz Posted May 1, 2006 Author Share Posted May 1, 2006 have you tryed filegetlongname(@desktopdir) Always does the same... Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 1, 2006 Share Posted May 1, 2006 could you tell me the outcome of it? Link to comment Share on other sites More sharing options...
guigz Posted May 1, 2006 Author Share Posted May 1, 2006 could you tell me the outcome of it?Outcome?I do not understand(french boy) Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 1, 2006 Share Posted May 1, 2006 (edited) make it a messagebox Example msgbox(0,"Test",FileGetLongName(@desktopdir)) Edited May 2, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
nfwu Posted May 2, 2006 Share Posted May 2, 2006 Outcome?He means "Does it work?"#) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 2, 2006 Share Posted May 2, 2006 (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 May 2, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 2, 2006 Moderators Share Posted May 2, 2006 (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 ... And welcome to the forums. Edit: Typo Edited May 2, 2006 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 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