Sign in to follow this  
Followers 0
Mark van Zon

Documents And Setting

4 posts in this topic

I'm making a script, and i want to copy a file to

C:\Documents and Settings\Eigenaar\Mijn documenten (Dutch)

But on other computers is the name:"Eigenaar" not the same, how can i config my script so, that when he runs, that he automatic knows the on that moment logged user

Example

My username on windows is Mark

I run this script and then the scripts automatic knows that the username is Mark (

C:\Documents and Settings\Mark\Mijn documenten)

Share this post


Link to post
Share on other sites



Add a variable to get the username of the currently logged in user.

$var = @Username
$MyDocs = "c:\Documents and Settings\" & $var & "\Mijn documenten"

OR

$Docs = "C:\Documents and Settings\" & @Username & "\Mijn documenten"

Hope this helps.

KilRoy

Share this post


Link to post
Share on other sites

:)

use macro function @MyDocumentsDir

Share this post


Link to post
Share on other sites

Micha1405,

Thanks, I hadn't seen that one. Guess I should read the Help a little more!!

KilRoy

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