Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Set DOS variable in the logon script

Posted on 1998-11-02
4
Medium Priority
?
680 Views
Last Modified: 2013-12-23
Hi.

I would like to set an DOS variable VUSER to the value
of username in the logon script. I tried thinks like
SET VUSER=%USERNAME% but it did'n help. The script will
run on WIN95 and maybe on DOS 6.22 with latest LANMAN
client too. It used to be so easy with Novell !
My server runs NT 4.0. I even tried to
write a simple C program, but I havent find any
method how to set an environment variable from the
code. How is it done in the Novell client ?
0
Comment
Question by:sladecek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 7

Expert Comment

by:BlackMan
ID: 1565173
To set an environmentvariable from code is simple, just write the key in the registry at System\CurrentControlSet\Control\Session Manager\Environment and send the WM_WININICHANGE message (in Delphi it looks like   SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0, LongInt(PChar('Environment'))); )
One problemt is that you can't use the environmentvariable further down your logon script, as you can't change the environment for a running process (at least this is true for NT, I'm not quite sure for Win95)

0
 

Author Comment

by:sladecek
ID: 1565174
Thank you for your information. Unfortunatellt, my question was not stated clearly enough.
My server is running NT. My clients are running WIN95 (most of them) or
MS DOS (some of them). I would like to write a logon script which will reside
on the server and will be run on the clients at logon. This script should change the
clients' environment, not the servers'. You method is not useable
as MS DOS has no registry at all and WIN95 has no "Environment" key
in it.

0
 
LVL 1

Accepted Solution

by:
PJansen earned 200 total points
ID: 1565175
I would advise you to use Kixtart. It's a login script language with many many options including your variable problem.
Kixtart is made by microsoft and free available on http://netnet.net/~swilson/kix.
There are some examples there too, it's very easy to use.

Peter
0
 

Author Comment

by:sladecek
ID: 1565176
Hi,

thank you for your answer. Althoug the Kixtart cannot set
the win95 environment (it is even stated in the manual),
it was of great value to me, as the documentation pointed
me to the winset utility delivered with the win95 itself.

regards


L. Sladecek
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nslookup is a command line driven utility supplied as part of most Windows operating systems that can reveal information related to domain names and the Internet Protocol (IP) addresses associated with them. In simple terms, it is a tool that can …
This is the first one of a series of articles I’ll be writing to address technical issues that are always referred to as network problems. The network boundaries have changed, therefore having an understanding of how each piece in the network  puzzl…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question