Page 1 of 1 1
Topic Options
#17213 - 2002-02-08 01:33 AM %SYSTEMDRIVE%
Anonymous
Unregistered


Anyone else seem to notice %SYSTEMDRIVE% only works in the script but if you shell out and use %SYSTEMDRIVE% it doesn't work at all.

On 9x boxes only

Runnin Kixtart 3.63

would seem if it wouldn't work in shell environment it wouldn't work in the script environment?!?!?!??!

COMMENTS ANYONE?

Top
#17214 - 2002-02-08 07:38 AM Re: %SYSTEMDRIVE%
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
environment variables may differ on console and in kix...
but I checked it out and yes, win9x box'es do not have systemdrive-variable set in console.
also systemdir is missing, whilst it's foundable trough registry in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion

maybe someone wiser can say if it should be available in script either.

cheers,

_________________________
!

download KiXnet

Top
#17215 - 2002-02-08 08:56 AM Re: %SYSTEMDRIVE%
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
armybrat,

Found from one of the "long-time" batch file gurus (Tom Levedas) the answer is no from Google Newsgroups and specifically the alt.Ms-DOS Newsgroup .

But, there is hope here reading the resulting replies from the above referenced NewsGroup.

It looks kind of like this..

code:

$Sysdrive = SUBSTR( "%windir%", 1, 2 ) ; -- What this does is get the C:
; -- borrowing a bit of code from - http://www.jsiinc.com/SUBA/tip0100/rh0120.htm
$L = "@LSERVER" + "\" + "NETLOGON" + "\" + "WINSET.EXE"
shell "$L SYSTEMDRIVE=$Sysdrive"
setl "SYSTEMDRIVE=$Sysdrive"

HTH,

- Kent

[ 08 February 2002: Message edited by: kdyer ]

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#17216 - 2002-02-08 09:02 AM Re: %SYSTEMDRIVE%
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
kdyer, here is the weird part, it works internally.
so pure no can't be the answer.
_________________________
!

download KiXnet

Top
#17217 - 2002-02-08 09:20 AM Re: %SYSTEMDRIVE%
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Lonkero,

When you can determine where Windows is installed at, you should be able to setup the systemdrive variable..

Thanks!

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#17218 - 2002-02-08 09:24 AM Re: %SYSTEMDRIVE%
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
kdyer,
you missed my question or irony towards the guru...

if you read the first post:

quote:
Anyone else seem to notice %SYSTEMDRIVE% only works in the script but if you shell out and use %SYSTEMDRIVE% it doesn't work at all.

so it works in the script. without any creation.
I know you can make it to be, but thing is, how it can allready be there, when it shouldn't.

_________________________
!

download KiXnet

Top
#17219 - 2002-02-08 05:13 PM Re: %SYSTEMDRIVE%
Anonymous
Unregistered


I think I've figured out what's going on with "my" script anyway. Kix32.exe on my 9x boxes is running from the %windir% so I can get by with using "\" 'go to root'.
Remember the issue is the differenece between %systemdrive% while shelling out or during script environment processing. I'm thinking once were shelled out were more under the unfluence of the the old DOS environment. ANd in script env. Kix maybe can handle ignoring a few things like %systemdrive%

Watch for word wrapping

Below won't work on 9x but will NT(I understand why it works in NT)I don't think
the old DOS environment likes %systemdrive% in fact if you do a set command from the prompt you will not see %systemdrive% set. But NT will.

shell "%comspec% /e:1024 /c copy @LDRIVE\ntsdprim.exe %SYSTEMDRIVE%"

while shelling for 9X it has to be like below

shell "%comspec% /c copy \\kixiistestsvr\netlogon\9xsdprim.exe \"

But below works in the script run-time, however I believe what is happening is the
%SYSTEMDRIVE% is being just being ignored by KIX and the following "\" is working.

IF exist ("%SYSTEMDRIVE%\9xsdprim.exe")

Hope I didn't confuse this issue more than it already was. Thanks for previous replies!

More comments guys and gals ?!?!?

Shawn

Top
#17220 - 2002-02-09 05:14 PM Re: %SYSTEMDRIVE%
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
armybrat,

Please excuse the long URLs in this response.

%systemdrive% does not exist in 9x.

Try this..

Go to - http://groups.google.com/groups?oi=djq&as_ugroup=alt.msdos.batch

Search within the alt.msdos.batch and search for systemdrive..

First result - http://groups.google.com/grou ps?q=systemdrive+group:alt.msdos.batch.*+group:alt.msdos.batch.*&hl=en&selm=7o6ud1%24hnq%241%40nnrp1.deja.com&rnum=1

Should be the right one.. Tell it to show all articles for this thread..

I tried to paste in the whole URL of all of this, but did not work. Let's try this again - http://groups.google.com/groups?hl=en&threadm=7o6ud1%24hnq%241%40nnrp1.deja.com&rnum=1&prev=/groups%3Fq%3Dsystemdrive%2Bgroup:alt.msdos.batch.*%2Bgroup:alt.msdos.batch.*%26hl%3Den% 26selm%3D7o6ud1%2524hnq%25241%2540nnrp1.deja.com%26rnum%3D1

This is where I got my answer from.. So, I took what little I could find and expand upon it. Armed with this information is where the resulting KIX Code came from above.

Thanks!

- Kent

[ 09 February 2002: Message edited by: kdyer ]

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#17221 - 2002-02-12 02:31 AM Re: %SYSTEMDRIVE%
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
Armybrat -
To avoid the whole shelling out aspect, you could do something like below.

Bill

code:

IF (@INWIN = 1)
$OSDir = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion", "SystemRoot")
$OSDrv = SUBSTR ($OSDir, 1, 2)
$OSSys = "System32"
ELSE
$OSDir = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion", "SystemRoot")
$OSDrv = SUBSTR ($OSDir, 1, 2)
$OSSys = "System"
ENDIF

COPY "@LDRIVE\(filename)" "$OSDrv\"

or perhaps

COPY "@LDRIVE\(filename)" "$OSDir\$OSSys"



Top
#17222 - 2002-02-19 11:20 PM Re: %SYSTEMDRIVE%
Anonymous
Unregistered


Bill,

Thanks for your reply.

That would get the files copied to the
%windir% which is where much to my surprise my IE patch files were being DL'd to anyway
I thought they were going it to root. or "\"

Since my login.bat is copying the KIX runtime files to windir anyway that's where they were winding up.

Once I realized what was happening I just started copying from ldrive to "\" and all files were copied to root while shelling.

Later

Top
#17223 - 2002-02-20 01:55 AM Re: %SYSTEMDRIVE%
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
Armybrat,
The value $OSDrv will be a 2-character variable along the lines of C:, D: etc. The $OSDir variable would be the same as %windir%, but of course we are using the registry value that creates $OSDir to get to the drive letter to create $OSDrv.
Bill

Top
#17224 - 2002-02-22 12:28 AM Re: %SYSTEMDRIVE%
Anonymous
Unregistered


Thanks BIll,

There is more than one way to skin a cat

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 581 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.058 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org