Page 1 of 2 12>
Topic Options
#69065 - 2002-08-15 07:46 PM Kix 2.33 script
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
Hey guys,
I have been having trouble with my boot disk script ever since I added the machines data to the script.
Everything works fine in the script but now it won't write to the log file. that is the only trouble I am having. Here is 2 samples of one that works without the machien data and 1 that does not work with the machine data.

Case 1 that works.
code:
 
;===================================
;***** Last Modified on 8/12/2002 at 10:56:29 AM by Whetrick *****
;===================================

Break ON

:start
$count = 0
$Numhds = %numhds%

Sleep 1
CLS
Color b/n
Box(0,0,24,80,grid)
Color g/n

AT ( 6,25) "1. Reload Windows 2000 V5.5"
AT ( 7,25) "2. Test New Windows 2000 Version"
AT ( 8,25) "3. Load Windows 2000 Visual Age"
AT ( 9,25) "4. Load Windows 2000 V5.5 for Disaster Recovery"
AT (10,25) "5. Log Computer to Inventory file"
AT (11,25) "6. Surplus Machine info and Wipe Hard drive"
AT (13,25) "x. Exit to DOS"
Color w/n
AT (17,25) "Enter 1-6 or 'x' to quit"

Get $jump
While $jump <> 'x' AND ($jump < '1' OR $jump > '6')
Get $jump
Loop

Goto $jump

:1 ; run
CLS
Color b/n
Box(0,0,24,80,grid)
Color g/n
AT ( 6,25) "ReLoading Windows 2000"
Shell "%comspec% /c echo @DATE @TIME,Reloaded,None,sysprep,5.5,N/A,@Address >> h:\cinfo.txt"
Shell "%comspec% /c Call I:\win2k.bat"
Goto start

:2 ; run
CLS
Color b/n
Box(0,0,24,80,grid)
Color g/n
AT ( 6,25) "Loading Windows 2000 for Test Machine"
Shell "%comspec% /c echo @DATE @TIME,Reloaded,None,sysprep,5.5,N/A,@Address >> h:\cinfo.txt"
Shell "%comspec% /c Call I:\dc5.1\win2k.bat"
Goto start

:3 ; run
CLS
Color b/n
Box(0,0,24,80,grid)
Color g/n
AT ( 7,25) "Loading Windows 2000 Visual Age"
Shell "%comspec% /c echo @DATE @TIME,Reload,Reload,Visual Age ,4.0,N/A,@Address >> h:\cinfo.txt"
Shell "%comspec% /c call I:\va.bat"
Goto start

:4 ; run
CLS
Color b/n
Box(0,0,24,80,grid)
Color g/n
AT ( 7,25) "Loading Windows Disaster Recovery"
Shell "%comspec% /c echo @DATE @TIME,Disaster,Recovery,sysprep,5.5,N/A,@Address >> h:\cinfo.txt"
Shell "%comspec% /c call I:\win2k.bat"
Goto start

:5 ; run
Color b/n
Box(0,0,24,80,grid)
Color g/n
AT ( 8,25) "Log machine info"
AT (10,25) "Would you like to log machine"
AT (11,25) "Info for disaster recovery?"
AT (12,25) "1. Yes"
AT (13,25) "2. NO"
Color w/n
AT (15,25) "Enter 1 or 2"

Get $jump
While ($jump < '1' OR $jump > '2')
Get $jump
Loop
If $jump = '1'
Shell "%comspec% /c echo @DATE @TIME,Disaster,Recovery,sysprep,5.5,N/A,@Address >> h:\cinfo.txt"
Else
Shell "%comspec% /c echo @DATE @TIME,Reloaded,None,sysprep,5.5,N/A,@Address >> h:\cinfo.txt"
EndIf

CLS
Color b/n
Box(0,0,24,80,grid)
Color g/n
AT ( 7,25) "Logging Machine info to file"
Goto X

:6 ; run
CLS
Color b/n
Box(0,0,24,80,grid)
Color g/n
AT ( 8,25) "Surplus Machine info"
AT (10,25) "This will Erase the hard drive completely"
AT (11,25) "Are you sure you want to continue?"
AT (12,25) "1. Yes"
AT (13,25) "2. NO"
Color w/n
AT (15,25) "Enter 1 or 2"

Get $jump
While ($jump < '1' OR $jump > '2')
Get $jump
Loop
; AT (20,0) "Please wait! This will take some time. The computer will reboot when finished."
If $jump = '1'
Shell "%comspec% /c echo @DATE @TIME,Surplus,Surplus,Wiped Drive,Clean,N/A,@Address >> h:\cinfo.txt"
CLS
While $count <> $numhds
Shell "%comspec% /c a:\wipe.com $count < a:\yes.dat"
$count = $count + 1
Loop
Shell "%comspec% /c a:\aefdisk.exe /reboot >> a:\wipe.log"
Else
Goto X
EndIf

Exit 1

:X ; run
CLS
Color w/n
Box(8,20,15,50,single)
AT (10,25) " Exiting to DOS"
Sleep 1
CLS
Exit

Case 2 that does not work.
code:
 ;===================================
;***** Last Modified on 8/15/2002 at 1:17:32 PM by Whetrick *****
;===================================

Break ON

:start
$count = 0
$check = 0
$Numhds = %numhds%
$Allsize = %allsize%
Sleep 1
CLS
If Exist ("q:\bin\smbios.txt")
Open (1,"q:\bin\smbios.txt")
While $check <> '28'
$Check = $check + 1
$X = ReadLine(1)
Loop
$Manu = ReadLine(1)
$Model = ReadLine(1)
$version = ReadLine(1)
$Serial = ReadLine(1)
Close(1)
EndIf
$MANU = SubStr($MANU,26,Len($manu))
$Manu = SubStr($manu,1,Len($manu)-1)
Set "manu = $manu"

$Model = SubStr($model,26,Len($model))
$Model = SubStr($Model,1,Len($Model)-1)

$version = SubStr($version,26,Len($version))
$version = SubStr($version,1,Len($version)-1)
$addtwo = $model + " " + $version
Set "model = $addtwo"

$Serial = SubStr($Serial,26,Len($Serial))
$Serial = SubStr($Serial,1,Len($Serial)-1)
SetL "serial = $serial"

:menu
Color b/n
Box(0,0,24,80,grid)
Color g/n
; AT ( 1,17) $MANU " "$MODEL " "$VERSION " "$SERIAL
AT ( 4,23) "The number of Hard drives are " $Numhds
AT ( 5,23) "The Size(s) of the drives are " $Allsize
AT ( 6,23) "1. Reload Windows 2000 V5.5"
AT ( 7,23) "2. Test New Windows 2000 Version"
AT ( 8,23) "3. Load Windows 2000 Visual Age"
AT ( 9,23) "4. Load Windows 2000 V5.5 for Disaster Recovery"
AT (10,23) "5. Log Computer to Inventory file"
AT (11,23) "6. Surplus Machine info and Wipe Hard drive"
AT (13,23) "x. Exit to DOS"
Color w/n
AT (17,23) "Enter 1-6 or 'x' to quit"

Get $jump
While $jump <> 'x' AND ($jump < '1' OR $jump > '6')
Get $jump
Loop

Goto $jump

:1 ; run
CLS
Color b/n
Box(0,0,24,80,grid)
Color g/n
AT ( 6,25) "ReLoading Windows 2000"
Shell "%comspec% /c /e:1024 echo @DATE @TIME,Reloaded,None,sysprep,5.5,N/A,@Address,$Manu,$model,$serial >> h:\cinfo.txt"
Shell "%comspec% /c /e:1024 Call I:\win2k.bat"
Goto start

:2 ; run
CLS
Color b/n
Box(0,0,24,80,grid)
Color g/n
AT ( 6,25) "Loading Windows 2000 for Test Machine"
Shell "%comspec% /c /e:1024 echo @DATE @TIME,Reloaded,None,sysprep,5.5,N/A,@Address,$Manu,$model,$serial >> h:\cinfo.txt"
Shell "%comspec% /c /e:1024 Call I:\dc5.1\win2k.bat"
Goto start

:3 ; run
CLS
Color b/n
Box(0,0,24,80,grid)
Color g/n
AT ( 7,25) "Loading Windows 2000 Visual Age"
Shell "%comspec% /c /e:1024 echo @DATE @TIME,Reload,Reload,Visual Age ,4.0,N/A,@Address,$Manu,$model,$serial >> h:\cinfo.txt"
Shell "%comspec% /c /e:1024 call I:\va.bat"
Goto start

:4 ; run
CLS
Color b/n
Box(0,0,24,80,grid)
Color g/n
AT ( 7,25) "Loading Windows Disaster Recovery"
Shell "%comspec% /c /e:1024 echo @DATE @TIME,Disaster,Recovery,sysprep,5.5,N/A,@Address,$Manu,$model,$serial >> h:\cinfo.txt"
Shell "%comspec% /c /e:1024 call I:\win2k.bat"
Goto start

:5 ; run
Color b/n
Box(0,0,24,80,grid)
Color g/n
AT ( 8,25) "Log machine info"
AT (10,25) "Would you like to log machine"
AT (11,25) "Info for disaster recovery?"
AT (12,25) "1. Yes"
AT (13,25) "2. NO"
Color w/n
AT (15,25) "Enter 1 or 2"

Get $jump
While ($jump < '1' OR $jump > '2')
Get $jump
Loop
If $jump = '1'
Shell "%comspec% /c /e:1024 echo @DATE @TIME,Disaster,Recovery,sysprep,5.5,N/A,@Address,%model%,%serial%, >> h:\cinfo.txt"
Else
Shell "%comspec% /c /e:1024 echo @DATE @TIME,Reloaded,None,sysprep,5.5,N/A,@Address,$Manu,$model,$serial, >> h:\cinfo.txt"
EndIf

CLS
Color b/n
Box(0,0,24,80,grid)
Color g/n
AT ( 7,25) "Logging Machine info to file"
Goto menu

:6 ; run
CLS
Color b/n
Box(0,0,24,80,grid)
Color g/n
AT ( 8,25) "Surplus Machine info"
AT (10,25) "This will Erase the hard drive completely"
AT (11,25) "Are you sure you want to continue?"
AT (12,25) "1. Yes"
AT (13,25) "2. NO"
Color w/n
AT (15,25) "Enter 1 or 2"

Get $jump
While ($jump < '1' OR $jump > '2')
Get $jump
Loop
If $jump = '1'
Shell "%comspec% /c /e:1024 echo @DATE @TIME,Surplus,Surplus,Wiped Drive,Clean,N/A,@Address,$Manu,$model,$serial >> h:\cinfo.txt"
CLS
While $count <> $numhds
Shell "%comspec% /c q:\bin\wipe.com $count < q:\bin\yes.dat"
$count = $count + 1
Loop
Shell "%comspec% /c q:\bin\aefdisk.exe /reboot >> a:\wipe.log"
Else
Goto X
EndIf

Exit 1

:X ; run
CLS
Color w/n
Box(8,20,15,50,single)
AT (11,27) " Exiting to DOS"
Sleep 1
CLS
Exit

_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#69066 - 2002-08-15 07:59 PM Re: Kix 2.33 script
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
code:
$check=0
While $check <> '28'
$check=$check+1
loop

I think that comparing a number to a string may cause an issue.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69067 - 2002-08-15 08:03 PM Re: Kix 2.33 script
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
Howard,
That part works. All I am doing that is reading the extra lines out before I get the lines I want to read in the smbios text file. I have displayed the computers serial number, model and make on the screen to make sure they picked up. My problem is where it shell's out to an echo command that filters it to the h:\cinfo.txt file.
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#69068 - 2002-08-15 08:12 PM Re: Kix 2.33 script
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
code:
Shell "%comspec% /c /e:1024 echo @DATE @TIME,Surplus,Surplus,Wiped Drive,Clean,N/A,@Address,$Manu,$model,$serial >> h:\cinfo.txt"  

I think that the space between @Date and @Time/ Wipe and Drive is the killer. Find a way to remove and what happens?

[ 15. August 2002, 20:13: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69069 - 2002-08-15 08:14 PM Re: Kix 2.33 script
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
Howard,
That is not the problem. The problem start after I added the $manu,....... The date and time has word flawlessly with the sapce between them for about 6 months.

I was wondering if having variables in the echo command was stoping it.

[ 15. August 2002, 20:15: Message edited by: Will Hetrick ]
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#69070 - 2002-08-15 08:26 PM Re: Kix 2.33 script
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
If I change the %comspec% switch order it works here.

Shell "%comspec% /e:1024 /c echo

instead of

Shell "%comspec% /c /e:1024 echo
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69071 - 2002-08-15 08:44 PM Re: Kix 2.33 script
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
Howard,
Nope did not work. What I get is the point at which it is shelling out, the computer freezes and it hangs on to the server.
are you using the 16 bit version 2.33 to run this with in dos mode?
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#69072 - 2002-08-15 08:47 PM Re: Kix 2.33 script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I've seen some time before something similar with long echo lines.
try shortening it.
like divide it to two lines.
_________________________
!

download KiXnet

Top
#69073 - 2002-08-15 08:53 PM Re: Kix 2.33 script
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
Lonkero,
I will try that tomorrow and let you know how it goes. Time to head home.
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#69074 - 2002-08-15 09:10 PM Re: Kix 2.33 script
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I would put the command that is to be SHELLed out into a string first. Then you can do a
code:
$shellcommand='%COMSPEC% /e:1024 /c ECHO Whatever'
? $shellcommand
shell $shellcommand

and look at the string. It might help to find out why it's not working by then typing in the command manually in a DOS prompt.
_________________________
There are two types of vessels, submarines and targets.

Top
#69075 - 2002-08-15 09:18 PM Re: Kix 2.33 script
Schuliebug Offline
Hey THIS is FUN
*****

Registered: 2002-01-18
Posts: 379
Loc: Netherlands
i have had same with long lines so i have to agree with Lonkero: look at the length of the line. Propably you can't go boyon 256 char ?
_________________________
Kind regards,

Top
#69076 - 2002-08-16 02:36 PM Re: Kix 2.33 script
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
I have not had any luck with any of the solutions provided. Does anyone see any no endif's or anything like that in the code?
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#69077 - 2002-08-16 02:42 PM Re: Kix 2.33 script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well...
I think you would find those with kixstrip...
or something.

anyway, you could change structure like:
code:
	Shell "%comspec% /c q:\bin\aefdisk.exe /reboot >> a:\wipe.log"
Else
Goto X
EndIf
Exit 1
:X ; run

to:
code:
 
Shell "%comspec% /c q:\bin\aefdisk.exe /reboot >> a:\wipe.log"
Exit 1
EndIf

anyway, now as I think of it. can 2.3x set the errorcode returned?
like should your exit be just "exit" without return value?
_________________________
!

download KiXnet

Top
#69078 - 2002-08-20 12:55 AM Re: Kix 2.33 script
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
I dug a little deeper into this and The problem seems to come from the echo command and using the '>>' to pipe it to the LAn drive. I can pipe the command to the local drive and everything is fine. I then tried piping it from the local drive to the lan drive and I recieved and insufficient disk space. When I pipe it using '>' It works but overwrites the whole file thus losing all the already cached workstations who login with windows 2000.
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#69079 - 2002-08-19 01:45 PM Re: Kix 2.33 script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what about using wipexxxx.log?

anyway, you are rebooting the machine so can't make any better syntax to it.
like, you could do just ">" and then copy the files together...
_________________________
!

download KiXnet

Top
#69080 - 2002-08-19 02:32 PM Re: Kix 2.33 script
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
Lonkero
What is wipexxxx.log??? [Confused]

I searched for it with google!

Anyways, This does not seems like a problem with kixtart now. I cannot even do this from a dos prompt.

[ 19. August 2002, 14:33: Message edited by: Will Hetrick ]
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#69081 - 2002-08-19 02:34 PM Re: Kix 2.33 script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hah [Big Grin]

really?

I ment that use for every time different log-file.

on installation packages you could use the to-be-computername
_________________________
!

download KiXnet

Top
#69082 - 2002-08-19 02:40 PM Re: Kix 2.33 script
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
dooh! [Eek!]

Ok, Just going to hide somewhere in a nice small crack. [Big Grin]

I am trying to find out which program now has conflicted to quit giving me rights to append a file on the lan.

My guess is aefdisk or smbios is the culprit.
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#69083 - 2002-08-19 02:51 PM Re: Kix 2.33 script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
will, have you tried does it work if you don't reboot the machine at the same line?
_________________________
!

download KiXnet

Top
#69084 - 2002-08-19 04:27 PM Re: Kix 2.33 script
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
Lonkero,
That part of the script actuallys works. I am more interested in the Echo command to the h:\cinfo.txt part of the script. Before I call the kix script, I run aefdisk /allsize and smbios /g 01 > smbios.txt. I took all those out of the batch file and it still does not let me append a file on the lan. I have 1 boot disk that does and 1 that does not. That one that does not is the one I updated with the said files.
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 302 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.143 seconds in which 0.098 seconds were spent on a total of 11 queries. Zlib compression enabled.

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