Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

Automatically Copy a file to a user's folder when logging in.

Windows 7, Terminal Server.  I need to copy a file to a users MyDocuments or other profile folder during the log in process.   This needs to occur after the server drive is mapped.  Any idea of the DOS syntax for any user?
0
Bill Ross
Asked:
Bill Ross
  • 2
  • 2
1 Solution
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
With Terminal Server, you can run login scripts that always fire. This article shows how to set that up:

http://support.microsoft.com/kb/195461

You could use that to fire off a Batch file that does your copy:

@echo off
xcopy "source", "destination"
0
 
Bill RossAuthor Commented:
xcopy "source", "destination"

This is the line I'm having trouble with.  The "destination" needs to be generic for the users "MyDocuments\xxx" folder"
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You can use Environment variables ... for example

xcopy "Source", %UserProfile%\My Documents\SomeFile.txt

http://support.microsoft.com/kb/121170

To see all the Environment variables available, open a DOS Prompt and type the word "SET" then press enter ... you'll see all the environment variables available on that machine.
0
 
Bill RossAuthor Commented:
Thanks.  I'll give it a try and get back with you.

Bill
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now