Re: Writing to the Environment ?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



JRS: In article <OivGXl1dFHA.2688@xxxxxxxxxxxxxxxxxxxx>, dated Wed, 22
Jun 2005 20:33:26, seen in news:microsoft.public.scripting.wsh, Torgeir
Bakken (MVP) <Torgeir.Bakken-spam@xxxxxxxxx> posted :
>Dr John Stockton wrote:
>
>> I know, more or less, how to write a script A.js or B.vbs, to be
>> executed by CSCRIPT at a command prompt in a MS-DOS box, that can
>> read the values of extant environment variables.
>>
>> Is it possible to write such a script that will change the extant
>> environment, so that the difference can be seen by a SET command
>> following the CSCRIPT - and, if so, how?
>>
>> I'm presently using Win98.

>To do master environment changes on Win9x, use the Microsoft utility
>WINSET.EXE which is on the OS CD-ROM (for example CD-DRIVE\tools
>\reskit\scrpting\winset.exe for Win98)
>
>and
>
>How to Set Global Environment Variables in Windows 95
>http://support.microsoft.com/kb/140574/
>
>Note this one (from the KB article above):
>
><quote>
>Note that running the Winset.exe tool at a command prompt has no
>effect in the current instance of the command prompt. A new command
>prompt must be launched before the change is apparent.
></quote>

I don't need those, AFAICS; from your description, I can do at least as
well in practice with my own external tools in Win98 - program STOW, for
example, using unit JRS_ENVU, via sig line 3.

But I don't know how to do it from within CSCRIPT code.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>.
Do not Mail News to me. Before a reply, quote with ">" or "> " (SoRFC1036)
.



Relevant Pages

  • Writing to the Environment ?
    ... executed by CSCRIPT at a command prompt in a MS-DOS box, ... the values of extant environment variables. ... Is it possible to write such a script that will change the extant ... following the CSCRIPT - and, if so, how? ...
    (microsoft.public.scripting.wsh)
  • Re: Script running infinitely when calling wscript.exe from code
    ... The fragment I posted did the job just fine as long as i switched the wsh engine to cscript before execution. ... If you are running your scripts from the command prompt or from within a batch file, try starting them with this command: ... It seems it calls the script over and over, but there is only one instance ... Sub Main ...
    (microsoft.public.scripting.wsh)
  • Re: Script to capture Logon Name from AD
    ... I have logged into multiple domains and the script runs great! ... The syntax to run the script at a command prompt is: ... This runs the VBScript program called CreateUserList3.vbs with the cscript ... This is the path and filename of the spreadsheet to be created. ...
    (microsoft.public.scripting.vbscript)
  • Re: Script to capture Logon Name from AD
    ... the script automatically connects to the domain you have authenticated ... The syntax to run the script at a command prompt is: ... This runs the VBScript program called CreateUserList3.vbs with the cscript ... This is the path and filename of the spreadsheet to be created. ...
    (microsoft.public.scripting.vbscript)
  • Re: Finding members of RDP groups of a list of computers
    ... Launch a command prompt. ... cscript //nologo RDPMembers.vbs ... MVP Directory Services ... I'm trying to find a script which will find the members of the rdp ...
    (microsoft.public.scripting.vbscript)