Re: Environment variables and paths
From: Pegasus \(MVP\) (I.can_at_fly.com)
Date: 12/01/04
- Previous message: Steve Parry [MVP]: "Re: USB Flash disks"
- In reply to: Kevin: "Re: Environment variables and paths"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 1 Dec 2004 20:37:13 +1100
setx.exe is an executable file, same as notepad.exe
or calc.exe. The syntax
notepad=abc
makes absolutely no sense, same as
setx=abc
makes no sense. There MUST be at least one
space (or some other suitable delimiter) between
the name of the executable and any parameters.
"=" is not a suitable delimiter.
The inbuilt help facility suggests this syntax:
setx variable value [-m]
Expanding this suggestion, one gets
"c:\program files\trk\setx.exe path %path%;c:\tools -m
If you are responsible for the maintenance of logon scripts,
and probably for server administration, then you might want
to familiarise yourself with the command line environment
and how to use executables and their parameters.
"Kevin" <Kevin@discussions.microsoft.com> wrote in message
news:9EB072CE-BF75-4B99-B227-F157ACE5A76B@microsoft.com...
> ok I used the m switch before the path and I get the command is not
> recognized and I tried it after the path and get the same thing. Can you
> just give me the correct syntax for my entry in the login script so we
don't
> have to keep going back and forth?
>
> "Pegasus (MVP)" wrote:
>
> > Your syntax is at variance with the example given by setx /?:
> >
> > Command Line Mode: setx variable value [-m]
> > Optional Switches:
> > -m Set value in the Machine environment. Default is User.
> >
> > a) You inserted an "=" where no "=" can exist.
> > b) You omitted the "-m" switch.
> >
> >
> > "Kevin" <Kevin@discussions.microsoft.com> wrote in message
> > news:8293659D-A31A-46DD-80DC-C9E43D1941EF@microsoft.com...
> > > @echo off
> > > setx=path %path%;l:\apps\wangbat
> > >
> > > "Kevin" wrote:
> > >
> > > > @echo off
> > > > path %path%;l:\apps\wangbat
> > > >
> > > > "Pegasus (MVP)" wrote:
> > > >
> > > > > Please quote the exact line from your logon script.
> > > > >
> > > > >
> > > > > "Kevin" <Kevin@discussions.microsoft.com> wrote in message
> > > > > news:6D9CCD6B-7C16-4D42-8BC8-6579C4321C05@microsoft.com...
> > > > > > I have the resource kit and it is installed.
> > > > > > So using the setx, what is the correct entry into my login
script
> > now? I
> > > > > > tried putting the setx into the script and it says it is not a
> > recognized
> > > > > > command.
> > > > > >
> > > > > > "Pegasus (MVP)" wrote:
> > > > > >
> > > > > > > As I said, setx.exe comes with the Win2000 Resource Kit.
> > > > > > > You must purchase the kit, install it, then refer to setx with
> > > > > > > a fully qualified address, eg.
> > > > > > > "c:\program files\Windows 2000 Resource Kit\setx.exe".
> > > > > > > To see the proper syntax, type
> > > > > > > "c:\program files\Windows 2000 Resource Kit\setx.exe" /?
> > > > > > >
> > > > > > >
> > > > > > > "Kevin" <Kevin@discussions.microsoft.com> wrote in message
> > > > > > > news:24A454D0-9017-45A8-AFA7-7541C02EC0B8@microsoft.com...
> > > > > > > > Sorry about the misinformation. So using the setx, what is
the
> > > > > correct
> > > > > > > entry
> > > > > > > > into my login script now? I tried putting the setx into the
> > script
> > > > > and it
> > > > > > > > says it is not a recognized command.
> > > > > > > >
> > > > > > > > "Pegasus (MVP)" wrote:
> > > > > > > >
> > > > > > > > > In your original post you said that you wanted to set the
path
> > > > > > > > > during the logon script. This is exactly what the "set"
> > command
> > > > > does:
> > > > > > > > > It sets an environmental variable while the logon script
runs.
> > When
> > > > > > > > > that process finishes, the settings are lost.
> > > > > > > > >
> > > > > > > > > If you want the settings to persist then you must use
> > setx.exe.
> > > > > > > > > It comes with the Win2000 Resource Kit. Any variable set
by
> > > > > > > > > setx will be available to all processes that are launched
> > > > > ***after***
> > > > > > > > > the execution of setx.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > "Kevin" <Kevin@discussions.microsoft.com> wrote in message
> > > > > > > > > news:6A2B171C-F233-4B63-A86F-BFB6E95669D5@microsoft.com...
> > > > > > > > > > Ok, I see it doing it in the login script but when I
goto a
> > dos
> > > > > prompt
> > > > > > > and
> > > > > > > > > > type in path, it is not there. How do I get it to
append to
> > my
> > > > > > > existing
> > > > > > > > > path
> > > > > > > > > > and save it?
> > > > > > > > > >
> > > > > > > > > > "Pegasus (MVP)" wrote:
> > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > "Kevin" <Kevin@discussions.microsoft.com> wrote in
message
> > > > > > > > > > >
news:72781F3B-03BF-410A-9F99-968959F748AD@microsoft.com...
> > > > > > > > > > > > Hello. I am trying to have a path set for users
during
> > the
> > > > > login
> > > > > > > > > script.
> > > > > > > > > > > I
> > > > > > > > > > > > need to set a drive that does the same thing as the
> > novell
> > > > > search
> > > > > > > > > drive.
> > > > > > > > > > > > Please help.
> > > > > > > > > > >
> > > > > > > > > > > Insert this line in your logon script to include
> > e:\YourTools in
> > > > > the
> > > > > > > > > path:
> > > > > > > > > > >
> > > > > > > > > > > @echo off
> > > > > > > > > > > path %path%;e:\YourTools
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > > >
> >
> >
> >
- Previous message: Steve Parry [MVP]: "Re: USB Flash disks"
- In reply to: Kevin: "Re: Environment variables and paths"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|