Guest Kristof Posted February 2, 2005 Share Posted February 2, 2005 Okay making a shortcut is fairly easy. But how can you program autit to copy a file of make a shortcut to the desktop for an account of which the name is unkown at the time you write the script. Exmaple: you install xp and you define the first account to be "user1". Yuo log on as user1 and then you want a script to copy a file to the desktop. Easy of course: filecopy("whatever","c:\doc & set\user1\desktop") but the above does not work whe you define the first account to be "Peter" instead of "user1". Is there some way to retrieve the first account name (if not it can be specified by quering the user) AND to that sepcific account name in a file copy function or a make shortcut function. Thanx for reading and helping, Kristof Link to comment Share on other sites More sharing options...
CyberSlug Posted February 2, 2005 Share Posted February 2, 2005 You could use @DesktopDir for the path to the current user's desktop (assuming you are logged on as that user). Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Developers Jos Posted February 2, 2005 Developers Share Posted February 2, 2005 Okay making a shortcut is fairly easy. But how can you program autit to copy a file of make a shortcut to the desktop for an account of which the name is unkown at the time you write the script.Exmaple:you install xp and you define the first account to be "user1".Yuo log on as user1 and then you want a script to copy a file to the desktop. Easy of course:filecopy("whatever","c:\doc & set\user1\desktop")but the above does not work whe you define the first account to be "Peter" instead of "user1".Is there some way to retrieve the first account name (if not it can be specified by quering the user) AND to that sepcific account name in a file copy function or a make shortcut function.Thanx for reading and helping,Kristof<{POST_SNAPBACK}>Would this work ?filecopy("whatever","c:\doc & set\" & @UserName & "\desktop") SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
sugi Posted February 2, 2005 Share Posted February 2, 2005 filecopy("whatever","c:\doc & set\" & @UserName & "\desktop")Never use this way if you can use @UserProfileDir or even better @DesktopDir. Usernames change, directories do not.The path C:\Documents and Settings\Alexandra.Meier can belong to the user Alexandra.Heimann when she marries. In worst case your script could even write data in the directory of another user. And yes, I've had this once (usernames were in different format) resulting in a lot of work for me since I had to recreate two useraccounts and sort their data into the right directories.And if you're not logged on as that user there's still a way to get the real profile path from HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList, but it's a bit more work. Link to comment Share on other sites More sharing options...
Guest Kristof Posted February 3, 2005 Share Posted February 3, 2005 Yup, @DesktopDir does the job pretty fine. Didn't knew those @ thingies even existed. Thank you all for replying and helping out !!!!! 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