koresho Posted November 5, 2007 Share Posted November 5, 2007 (edited) Anyone got a way to get the current username that a script is running under? Specifically I am trying to delete temp files. If i do a DirRemove(@TempDir), it will remove the folder too. I am thinking of doing: DirRemove(@TempDir) DirCreate("C:\Documents and Settings\[insert current user here]\Local Settings\Temp") Edited November 5, 2007 by koresho Link to comment Share on other sites More sharing options...
Developers Jos Posted November 5, 2007 Developers Share Posted November 5, 2007 @UserName ? AnonymousX 1 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...
koresho Posted November 5, 2007 Author Share Posted November 5, 2007 wow. i feel retarded now. Thanks a lot Link to comment Share on other sites More sharing options...
koresho Posted November 5, 2007 Author Share Posted November 5, 2007 Okay quick thing: Windows won't let me do that, the temp dir is a protected windows folder. Is there an efficient method that autoscript can delete the contents of the folder but not the folder itself? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 5, 2007 Moderators Share Posted November 5, 2007 Okay quick thing:Windows won't let me do that, the temp dir is a protected windows folder. Is there an efficient method that autoscript can delete the contents of the folder but not the folder itself?What reasoning/right do you have to delete someones temp folder? Do have any idea how many programs installed on your PC actually use the temp directory as a directory to store information?If there is something else you are trying to get at... now would be a good time to explain. 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...
koresho Posted November 5, 2007 Author Share Posted November 5, 2007 heh I see what you are thinking; here is the deal. I am making a general purpose tune-up program that handles many different functions, from fixing issues to cleaning virii to... removing temp files. No I didn't know that a lot of programs use the Temp dir to store data; I was under the impression that what Windows cleanup does is essentially delete the entire contents of the folder. Do you recommend against this? I certainly don't want to do anything to mess computers up. 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