Jump to content
Sign in to follow this  
Mark van Zon

Documents And Setting

Recommended Posts

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


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"


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

Hope this helps.


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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...