Re: Need Help Setting Variable

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 02/08/05


Date: Mon, 7 Feb 2005 19:10:44 -0700


"Donovan Linton" <DonovanLinton@discussions.microsoft.com> wrote in message
news:2A533A48-80AE-4D61-BE42-225B9C72B61D@microsoft.com...
> I dont have that type of access. I would like to have the script done from
AD
> and SMS.
> I was put in charge of migrating all the data for my dept, and I was
looking
> for the easiest way to do that.

I understood that. I was trying to suggest a company policy that would
prevent your ever having to do this again. Even though that is not what you
were asking for, I nonetheless assumed you might get some benefit from the
suggestion.

As for the task at hand, it is not clear to me what the intent is. Is it to:

- backup all information stored in all user profiles on a computer to be
replaced, so that the same data will just show up in the same place on the
new workstation?

- backup all information stored in all user profiles on a computer to be
replaced, so that the users can retrieve their data from some network share
as needed?

Also, will some users likely have similar or different data stored on
different workstations?

/Al

>
> Donovan
>
> "Al Dunbar [MS-MVP]" wrote:
>
> >
> > "Donovan Linton" <DonovanLinton@discussions.microsoft.com> wrote in
message
> > news:2B02B49A-F712-4428-87D5-34244C705FFA@microsoft.com...
> > > All the systems are WinXP (I just noticed it said Win2000),and
migrating
> > to
> > > new computers, I didn't user the %username% value because I will be
logged
> > in
> > > as myself running the migration.
> > >
> > > Thanks for your response.
> > >
> > > I was put in charge up migrating my departments data, so any more
> > suggestion
> > > to make this process easier is greatly apprecitated.
> >
> > One suggestion I would seriously consider is to adopt a policy that
storage
> > of departmental data NOT be allowed on workstations, but only on
servers.
> >
> > /Al
> >
> > > Donovan
> > >
> > > "Al Dunbar [MS-MVP]" wrote:
> > >
> > > >
> > > > "Donovan Linton" <Donovan Linton@discussions.microsoft.com> wrote in
> > message
> > > > news:0D094478-963B-4800-B093-C80324F3A331@microsoft.com...
> > > > > Hi Im pretty new to scripting but I need help getting/setting a
> > variable
> > > > > (don't know if Im saying that right)
> > > > >
> > > > >
> > > > > Basically what I want to do is have the script ask for the
username
> > and
> > > > then
> > > > > be able to assign it as a variable(Again, excuse me if I'm not
using
> > the
> > > > > correct words).
> > > >
> > > > First question: by "the username" do you mean the username of the
> > currently
> > > > logged in user, or is this a script you will be running from an
> > > > administrative account to do some processing against a whole bunch
of
> > other
> > > > normal user accounts.
> > > >
> > > > Second question: what operating system is running on the computer
from
> > which
> > > > this batch will be run?
> > > >
> > > > Way at the bottom are a few suggestions...
> > > >
> > > > > Heres what I have now.
> > > > >
> > > > > net use B: \\itchy\share
> > > > > net use Z: \\itchy\usmt
> > > > >
> > > > > md b:\%computername%_%1
> > > > >
> > > > > z:\scanstate b:\%computername%_%1 /user:%1 /i:migsys.inf
> > /i:miguser.inf
> > > > > /i:sysfiles.inf /c /o /v:1 /l:b:\Logs\%computername%_%1.txt
> > > > >
> > > > > net use B: /delete
> > > > > net use Z: /delete
> > > > >
> > > > > shutdown -l
> > > > >
> > > > >
> > > > > This works great but instead of having to open command and run
> > > > > bat.cmd dlinton
> > > > >
> > > > > I want the script to ask me the username and then substitute that
with
> > the
> > > > > %1 or what ever variable names.
> > > > >
> > > > > Thanks Any help appreicaited
> > > > > Donovan
> > > > >
> > > > > Also I will gladly take suggestions on the rest of the script.
> > > >
> > > > If this is running on an NT series system, and if the username is
that
> > of
> > > > the currently logged in user, then simply replace %1 with %username%
in
> > your
> > > > script. That environment variable is defined by the o/s to contain
the
> > name
> > > > of the currently logged in user, in much the same way that
> > %computername%
> > > > gives the name of the computer.
> > > >
> > > > If you actually need it to prompt for the username of another
account,
> > and
> > > > if you are running this from XP, w2k, or w2k3, then try this:
> > > >
> > > > (set/p user=Enter the username to be processed: )
> > > > > net use B: \\itchy\share
> > > > > net use Z: \\itchy\usmt
> > > > >
> > > > REM - replace - md b:\%computername%_%1
> > > > md b:\%computername%_%user%
> > > > >
> > > > REM - replace - z:\scanstate b:\%computername%_%1 /user:%1
/i:migsys.inf
> > > > /i:miguser.inf /i:sysfiles.inf /c /o /v:1
> > /l:b:\Logs\%computername%_%1.txt
> > > > z:\scanstate b:\%computername%_%user% /user:%user% /i:migsys.inf
> > > > /i:miguser.inf /i:sysfiles.inf /c /o /v:1
> > > > /l:b:\Logs\%computername%_%user%.txt
> > > > >
> > > > > net use B: /delete
> > > > > net use Z: /delete
> > > > >
> > > > > shutdown -l
> > > >
> > > > If you are running on NT or 9x, there are some workarounds available
to
> > > > simulate the input functionality.
> > > >
> > > >
> > > > Scanstate seems to be used for migrating user profile information
> > through an
> > > > o/s upgrade from 9x to 2k. Since you are explicitly doing a
shutdown, it
> > is
> > > > not clear to me what your answers are to my first question at the
top.
> > > > Assuming this will be run by the user account being processed, and
> > assuming
> > > > windows98, there is another way to determine the name of the current
> > user.
> > > > There is at least one command whose output includes the name of the
> > current
> > > > user on w98 systems (I think it is ipconfig/all, but lacking any w98
> > systems
> > > > at home, I am not sure). You could redirect this output to a file,
and
> > then
> > > > parse that file to extract the name.
> > > >
> > > >
> > > > /Al
> > > >
> > > >
> > > >
> >
> >
> >



Relevant Pages

  • Re: Backing up data in a workgroup
    ... USB external drive to one of the workstations; the NAS goes directly on the ... The backup software that comes with these drives usually isn't ... data with SC and burn DVDs. ... Elephant Boy Computers - Don't Panic! ...
    (microsoft.public.windowsxp.network_web)
  • Re: Migrated User Profiles not applied unless user has local admin rig
    ... >> workstations were formatted FAT32. ... >> I logged on to the old workstations as the Domain Admin and copied the ... >> user profiles on each machine to the server. ... >> was made a local admin, then the correct settings were applied. ...
    (microsoft.public.windowsxp.general)
  • Re: Backup fails with error Unable to open "D:" - skipped.
    ... 1.Click Start, click Run, type "ntbackup" and click OK. ... Windows Small Business Server\Backup", click Small BusinessBackup ... the backup completed without errors. ... Suggestion 2 worked as well but when I checked the console the SBS ...
    (microsoft.public.windows.server.sbs)
  • Re: what to backup
    ... The SBS backup covers everything stored on the server. ... It does not cover data stored on the workstations. ... Anything stored in their My Documents would be covered *if* you've chosen to enable My Documents Redirection on the SBS, as that moves those to the server and off the workstations. ...
    (microsoft.public.windows.server.sbs)
  • Migrating User Profiles After Moving To New Domain
    ... I'm comfortable using ADMT to move the user accounts. ... about the computer accounts & user profiles on the workstations. ... If I use ADMT to move computer accounts from Domain A to Domain B, ...
    (microsoft.public.win2000.active_directory)