Jump to content
Sign in to follow this  
wklw2005

Remote User profiles

Recommended Posts

wklw2005

Hello,

I am trying to copy 5 AutoCad files from the server remotely to the the user profile. Type the machine name in the input box, then check the radio button and the files copy.

Here is the code for the first radio button and it works great.

Case $msg = $Profiles And BitAND(GUICtrlRead($Profiles), $GUI_CHECKED) = $GUI_CHECKED
FileCopy("\\Server\Files", "\\" & GUICtrlRead($RemoteProfiles) & "\c$\Users\Public\Desktop")

Now I am trying to remotely copy some cad files to the current user logged in using the input box and clicking the second radio box.

The code below is not right.

Case $msg = $CUI And BitAND(GUICtrlRead($CUI), $GUI_CHECKED) = $GUI_CHECKED
FileCopy("\\Servername\Files", "\\" & GUICtrlRead($RemoteProfiles) & ,"\c$\@UserProfileDir\AppData\Roaming\Autodesk\AutoCAD 2010\R18.0\enu\Support")

Can someone please help.

Share this post


Link to post
Share on other sites
willichan

@UserProfileDir will give you the profile path for the currently logged in user on the machine the script is running on. It does not tell you who is logged in on the remote machine.

Share this post


Link to post
Share on other sites
wklw2005

Case $msg = $CUI And BitAND(GUICtrlRead($CUI), $GUI_CHECKED) = $GUI_CHECKED
FileCopy("ServernameFiles", "" & GUICtrlRead($RemoteProfiles) & ,"c$%currentuser%AppDataRoamingAutodeskAutoCAD 2010R18.0enuSupport")

so something like this?

Share this post


Link to post
Share on other sites
willichan

Again, %currentuser% will be a local variable, not a remote variable.

I wish I could tell you how to find who was logged in remotely, but I haven't researched that. Since technically, when you remotely access the machine, you are also logged in to that machine, you would not only have to determine who all is logged in, but also which one is the user actually sitting at the PC.

Unfortunately, it won't be so easy as just using a system variable.

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  

×