Jump to content

Get the current username?


koresho
 Share

Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...