Solved

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

Posted on 2014-07-30
4
267 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 85
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 85

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Configuring Remote Assistance for use with SCCM
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

631 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