Solved

How to run profile coping batch file before the profile loads in XP and 2000.

Posted on 2007-03-29
10
450 Views
Last Modified: 2013-12-04
I have batch file that will take user input – login name -  and copy files from profile <loginname> to profile <loginname.machinename>.
The question is – how can I run that batch file before the profile <loginname> loads?
I tried including it in wininit.ini -  no go.
Win.ini – also no go -  it loads after the profile is loaded.

User input is important in order to specify the correct source profile.
I need to roll it out on over 500 workstations with XP professional and win2000 operating systems.
I can't trust users to create 3-rd profile and initiate copy this way.
All help and suggestions are greatly appreciated.


0
Comment
Question by:lescluster
10 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 18817100
I don't believe you'll be able to, and grab input from the user, because the credential context will be that of the SYSTEM account, not a user.  The user won't be able to respond to those prompts until Windows has logged them on..
0
 
LVL 63

Expert Comment

by:SysExpert
ID: 18817115
If you need user input, then it needs to be run after login.

I would do it in a batch file and use the Username variable, and have it copy the profile.
At next login, it should be available.

You may have issues with security depedning if the user is a local admin or not.

You might need to give a little mre detail on what you are trying to accomplish in general, and see if there is a better way.

I hope this helps !
0
 
LVL 1

Expert Comment

by:Phamunda
ID: 18817214
Yeah, a little more information would be useful.  At first glance, this looks like it would be a great opportunity to use roaming/networked profiles.
0
 

Author Comment

by:lescluster
ID: 18817527
OK -  sorry for being so brief and thanks for fast advice. Here is the full scenario:
I had over 500 workstations under domain. Now we are getting away from domain. All users have profiles created on their workstations with the name in the form of username.machinename. The new profiles are empty - or at least they should be empty - meaning just a basic template stuff in there. SO -  when the user logs in with the new login (username.machinename) I would like to have their previous profile that they had when they were under the domain transfered to the new (user.machinename) profile.
Now - the user input issue -  just in case their old profile was not named username but let's say username.domainname - I would like them to specify that for  me before I do the copy. So I copy the right stuff. Perhaps there is other way to detect which profile should be copied -  I am not sure if there is a way to detect the size of the profile (the largest would be the one I want) or some other variable that can be used for the purpose of detecting the correct profile to copy.   I am even willing to abandon the copy process for users that have profiles other then username (presumably previous) and username.machinename (current) profiles on their workstation - if I have to get rid of user input to make it work. I will take care of those manually. Also - before I overwrite the new profile data (username.machinename) I would like to create a copy of that profile and store it on that workstation just in case for some sick reason the profile username.machinename is the loaded profile. Want to avoid destroying it just in case.
I am working primarily in web development so my skills in MS DOS are  somewhat limited -  I would appreciate if you can be as specific as possible in your comments. Thanks much in advance.
 
0
 

Author Comment

by:lescluster
ID: 18817557
One more thing -  users have administrative rights.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 63

Expert Comment

by:SysExpert
ID: 18817851
0
 

Author Comment

by:lescluster
ID: 18818498
Thanks -  looks like the
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/2000/Q_21113845.html
is about what I am trying to accomplish. However - Jdeclue says there "Now you have the username available to a script running in the computers startup script, which uses the local system authority to copuy username over username.domain."  Question is - what does he mean by "computers startup script"? How is that going to work if the profile is in use -  exclusive lock will not allow copy to be done successfully.
Any ideas?
0
 
LVL 63

Expert Comment

by:SysExpert
ID: 18818752
I think that you should do this in a logout script via GPO.  That may work.

You are going to have to do some testing.

0
 

Author Comment

by:lescluster
ID: 18819583
Looks like I found the solution -  will create batch file to get the user name and machine name- set it up on the machine. Then run the copy script that will read that file -  to run the copy script I will use PSExsec : http://www.microsoft.com/technet/sysinternals/utilities/psexec.mspx

Slight issue that results from my limited knowledge of batch scripting -  I need to echo out the profile directory size  to the netshare location -  can someone help me with teh script for that -  if possible?

Thanks
0
 
LVL 63

Accepted Solution

by:
SysExpert earned 500 total points
ID: 18819681
use the Dir command.

Post a new Q in the MSDOS TA.

I hope this helps !
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
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.

757 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

19 Experts available now in Live!

Get 1:1 Help Now