Sign in to follow this  
Followers 0

Get the current username?

6 posts in this topic

#1 ·  Posted (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 by koresho

Share this post


Link to post
Share on other sites



#3 ·  Posted

wow.

i feel retarded now.

Thanks a lot <_<

Share this post


Link to post
Share on other sites

#4 ·  Posted

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?

Share this post


Link to post
Share on other sites

#5 ·  Posted

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.


[center]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.[/center]

Share this post


Link to post
Share on other sites

#6 ·  Posted

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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0