Re: Need Help Setting Variable
From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 02/06/05
- Next message: Kevin Kramer: "Re: problems with enbeded for loop"
- Previous message: Donovan Linton: "Re: Need Help Setting Variable"
- In reply to: Donovan Linton: "Re: Need Help Setting Variable"
- Next in thread: Donovan Linton: "Re: Need Help Setting Variable"
- Reply: Donovan Linton: "Re: Need Help Setting Variable"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 5 Feb 2005 17:43:03 -0700
"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
> >
> >
> >
- Next message: Kevin Kramer: "Re: problems with enbeded for loop"
- Previous message: Donovan Linton: "Re: Need Help Setting Variable"
- In reply to: Donovan Linton: "Re: Need Help Setting Variable"
- Next in thread: Donovan Linton: "Re: Need Help Setting Variable"
- Reply: Donovan Linton: "Re: Need Help Setting Variable"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|