Solved

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

Posted on 2014-07-30
4
261 Views
Last Modified: 2014-08-01
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
Comment
Question by:Bill Ross
  • 2
  • 2
4 Comments
 
LVL 84
ID: 40228714
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
 
LVL 14

Author Comment

by:Bill Ross
ID: 40228721
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
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40228728
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
 
LVL 14

Author Comment

by:Bill Ross
ID: 40228743
Thanks.  I'll give it a try and get back with you.

Bill
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question