Sign in to follow this  
Followers 0
parkerbl

Really simple question

4 posts in this topic

I know this is a really really simple question, but I searched through the AutoIT help file and through the forums, but I couldn't find the exact answer. Okay, what is the wild card for a user's profile. An example of this would be like in batch scripting, the current person's profile that is logged in is stated as %username%, and in the AutoIT help file, it had @UserName as the current user's profile, but whenever I ran that in a script such in a line like this:

C:\Documents and Settings\@UserName\...\...\

It would always create a new profile under Documents and Setting called @UserName. So that is my question. What is the variable or whatnot that is used to put something in the current user's profile. Your help would be greatly appreciated. Thanks.

Share this post


Link to post
Share on other sites



from help file: @UserProfileDir - Path to current user's Profile folder.

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Hey Kurt, Thanks for the reply. Okay, I ran that @UserProfileDir in the following statement and it just created a new folder under Documents and Settings titled @UserProfileDir:

Here is the line of code:

DirCreate("C:\Documents and Settings\@UserProfileDir\Desktop\test")

Thanks.

Share this post


Link to post
Share on other sites

Try this...

DirCreate(@UserProfileDir & "\Desktop\test")

The macros that have to do with directories have the full path already. No need to add it yourself.

Now using your first example you could do the following (untested).

DirCreate("C:\Documents and Settings\" & @UserName & "\Desktop\test")

If you notice: The way to concactenate (add) macro's and or variables to a string you use the & symbol.

I hope this helps some,

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

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