Solved

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

Posted on 2014-07-30
4
253 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
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.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now