Re: Environment variables and paths

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Pegasus \(MVP\) (I.can_at_fly.com)
Date: 12/01/04

  • Next message: Geoff: "Norton Anti-Virus"
    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
    > > > > > > > > > > >
    > > > > > > > > > > >
    > > > > > > > > > > >
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > >
    > > > > >
    > > > > >
    > >
    > >
    > >


  • Next message: Geoff: "Norton Anti-Virus"

    Relevant Pages

    • Re: tr syntax
      ... >> Do you know the right syntax for the TR command to strip characters from ... > My guess is you are ultimately getting this data into filepro. ... Here's what my cgi script does: ...
      (comp.unix.sco.misc)
    • re: What is TWS_32?
      ... I wrote a script ... available as standalone executables on the CD I ... command line is all in one place for each process. ... Do You Yahoo!? ...
      (Security-Basics)
    • Re: udev rule writing help needed
      ... can be prevented by running the following command line: ... I'd like to get udev to set this for me, so I tried the following rule: ... I have found the rules easy to write and writing the executables called ... It is adapted from a udev triggered script I use to ...
      (Debian-User)
    • Re: .bat from asp.net w/System.Diagnostics.Process?
      ... The results of the script from the command prompt when run from an .aspx are ... The ftp call syntax that I am using allows you to have a text file with all of your ftp connection info in it. ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: udev rule writing help needed
      ... I have found the rules easy to write and writing the executables called ... It is adapted from a udev triggered script I use to ... command as root - in which case you will need to set up sudo to work for ... I tried triggering a script to just echo into a file, ...
      (Debian-User)