#17213 - 2002-02-08 01:33 AM
%SYSTEMDRIVE%
|
Anonymous
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
|
|
|
|
#17215 - 2002-02-08 08:56 AM
Re: %SYSTEMDRIVE%
|
Kdyer
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 ]
|
|
Top
|
|
|
|
#17219 - 2002-02-08 05:13 PM
Re: %SYSTEMDRIVE%
|
Anonymous
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
|
|
|
|
#17221 - 2002-02-12 02:31 AM
Re: %SYSTEMDRIVE%
|
bleonard
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" ENDIFCOPY "@LDRIVE\(filename)" "$OSDrv\" or perhaps COPY "@LDRIVE\(filename)" "$OSDir\$OSSys"
|
|
Top
|
|
|
|
#17222 - 2002-02-19 11:20 PM
Re: %SYSTEMDRIVE%
|
Anonymous
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
|
|
|
|
#17224 - 2002-02-22 12:28 AM
Re: %SYSTEMDRIVE%
|
Anonymous
Anonymous
Unregistered
|
Thanks BIll,There is more than one way to skin a cat 
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 581 anonymous users online.
|
|
|