Solved

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

Posted on 2014-07-30
4
260 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

829 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