Sign in to follow this  
Followers 0
ingenious_7

username in path

4 posts in this topic

Hi,

I am trying to create a login script for my network. I have most of it completed but I am having trouble with one part.

I am trying to copy files from a network location to the current logged in users profile path and home directory.

With a batch script it would be \\server\%username%. I have tried using the same method but with the @username macro but no luck.

Can someone please help. I'm sure this must be possible!

Share this post


Link to post
Share on other sites



You may need to do something like

\\server\" & @user

Share this post


Link to post
Share on other sites

Strings belong inside quotes, while macros don't like it as they then become a

part of the string. So you need to separate them like this, using ampersands.

$userpath = "\\server\" & @Username

Share this post


Link to post
Share on other sites

So if I want to use the FileCopy command will this work:

FileCopy("\\192.168.1.202\" & @USERNAME & "\Profile\Program*.*", "C:\Documents And Settings\" & @USERNAME & "\Profile\Program")

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