If you are doing a lot of repetitive tasks or wish for everyone to do things the same way all the time it is best to automate it!
Put that PXE server to work by creating some menu items for you. Below is a shot of what ours looks like and makes it very easy for techs to do things without having to remember the commands.
This is very simple to use like this and is easy to modify. To get the menu system to come up in a PXE boot first make the batch file. I call mine GO.BAT. It is placed in the express share as well as choice.com. Choice.com can be found for a quick web search if you do not have it handy on a floppy.
The contents of this batch file are as follows:
@ECHO OFF
:BEGIN
CLS
ECHO.
ECHO DOS UTILITIES MENU-PLEASE MAKE A CHOICE
ECHO.
ECHO.
ECHO 1=Remove All Hard Drive Partitions
ECHO 2=FDISK Hard Drive
ECHO 3=Format Hard Drive
ECHO 4=Dell Utilities
ECHO 5=Re-image
ECHO 6=Exit To DOS
ECHO.
ECHO To bring this menu back type GO.BAT at the dos prompt.
ECHO.
CHOICE /N /C:123456
rem PICK A NUMBER (1, 2, 3, 4, 5, OR 6)%1
ECHO.
If ERRORLEVEL ==6 GOTO SIX
If ERRORLEVEL ==5 GOTO FIVE
If ERRORLEVEL ==4 GOTO FOUR
IF ERRORLEVEL ==3 GOTO THREE
IF ERRORLEVEL ==2 GOTO TWO
IF ERRORLEVEL ==1 GOTO ONE
GOTO END
:SIX
EXIT
GOTO QUIT
:FIVE
call re-image.bat
GOTO END
:FOUR
call dell.bat
GOTO END
:THREE
cd dos
call format.bat
GOTO END
:TWO
cd dos
call fdisk.bat
GOTO END
:ONE
cd dos
call blast.bat
GOTO END
:END
cd\
REM ECHO Completed. Bringing up DOS menu again...
REM pause
REM f:go.bat
:QUIT
f:
Let me explain what we are doing here. The first section up to the code:
ECHO To bring this menu back type GO.BAT at the dos prompt.
ECHO.
Is what the user will see. Most of you are familiar with normal DOS commands. All we do is clear the screen and give the user choices.
The following part takes the user input and then does what you tell it depending on what number they pressed. Here they have 6 choices.
CHOICE /N /C:123456
rem PICK A NUMBER (1, 2, 3, 4, 5, OR 6)%1
ECHO.
If ERRORLEVEL ==6 GOTO SIX
If ERRORLEVEL ==5 GOTO FIVE
If ERRORLEVEL ==4 GOTO FOUR
IF ERRORLEVEL ==3 GOTO THREE
IF ERRORLEVEL ==2 GOTO TWO
IF ERRORLEVEL ==1 GOTO ONE
GOTO END
I will start by using choice number 6 first as it is fairly simple. This choice is Exit To DOS. When they press the 6 key CHOICE.COM takes the input from the user and the runs the menu item SIX. If ERRORLEVEL ==6 GOTO SIX goes directly to whatever is in the batch file after :SIX.
:SIX
EXIT
GOTO QUIT
You can see if we choose SIX then we GOTO QUIT. :QUIT contains just a very simple command to open drive F. This will take you to a DOS prompt in the express share.
The menu choice 5 will run this command:
:FIVE
call re-image.bat
GOTO END
What we now are doing is calling a small batch file named reimage.bat. Here are the contents of reimage.bat:
@ECHO OFF
amouse
rdeploy
All we are doing is calling the mouse driver through the amouse.exe and the rapid deploy console through rdeploy.exe. Great for people who don't do a lot of imaging and can't remember the commands.
Choice number 4 runs all of our Dell diagnostics from the network instead of trying to find the CDs. This saves us a lot of time and makes it pretty simple for repairs.
:FOUR
call dell.bat
GOTO END
Here is where some work on the front will save a lot of time. We have copied all the Dell utilities to a Dell folder on the express share and can choose what we need and also update as necessary. I won't explain everything for this batch file but here is a peek at it:
@ECHO OFF
:BEGIN
CLS
ECHO **************
ECHO Which Utility?
ECHO **************
ECHO.
ECHO 1=Dell Laptop Diagnostics
ECHO 2=Dell Optiplex Diagnostics
ECHO 3=Dell GX150 Diagnostics
ECHO 4=Dell Laptop Service Tag Utility
ECHO 5=Optiplex Service Tag Utility
ECHO 6=Return to Main Menu
ECHO 7=Brand BIOS to IISD
ECHO.
ECHO.
CHOICE /N /C:1234567
rem PICK A NUMBER (1, 2, 3, 4, 5, 6, OR 7)%1
ECHO.
IF ERRORLEVEL ==7 GOTO SEVEN
IF ERRORLEVEL ==6 GOTO SIX
IF ERRORLEVEL ==5 GOTO Five
IF ERRORLEVEL ==4 GOTO Four
IF ERRORLEVEL ==3 GOTO THREE
IF ERRORLEVEL ==2 GOTO TWO
IF ERRORLEVEL ==1 GOTO ONE
GOTO END
:SEVEN
cd splash
call splash.bat
GOTO END
:SIX
EXIT
GOTO END
:Five
cd f:\dell
ECHO OPTIPLEX SERVICE TAG CHANGER USAGE
ECHO **********************************
ECHO.
ECHO THE FILE TO USE IS ASSET209.COM, USAGE EX:
ECHO ASSET209.COM /S ABCD123
ECHO WHERE ABCD123 IS THE SERVICE TAG OF THE UNIT
ECHO.
ECHO TYPE THE NECESSARY COMMAND NOW!
ECHO HAVE A GREAT DAY
Goto End
:FOUR
cd f:\dell\svctag
call f:\dell\svctag\svctag.exe
GOTO END
:THREE
cd f:\dell\gx150d
call f:\dell\gx150d\delldiag.exe
:TWO
cd f:\dell\optdiags
call f:\dell\optdiags\delldiag.exe
:ONE
cd f:\dell\diags
call f:\dell\diags\diags.exe
GOTO END
:END
Choice number 3 is there so format is run the same way all the time.
:THREE
cd dos
call format.bat
GOTO END
Format.bat contents are very simple and contain two lines:
format c: /C
cd\
All we wanted to do was make sure everyone formatted the drive with the /C switch. Now they do without having to remember.
Choice number 2 just calls fdisk.exe with no parameters so I won't bore you with that one. It is just one of our hard drive diagnostic tests we use.
Choice number 1 saves a ton of time and consists of a couple batch files calling others. The easiest way to remove NTFS partitions if there are multiple partitions on a drive is to use the old DEBUG command.
Menu item number 1 has the following and calls a batch file named blast.bat.
:ONE
cd dos
call blast.bat
GOTO END
Blast.bat contains the following code:
DEBUG < BLAST2.BAT
That's it. Pretty simple but was difficult to figure out. We need to start the DEBUG process and then call another batch file which has the proper debug commands to delete all the hard drive partitions.
Blast2.bat contents are as follows:
GOTO BEGIN
F 200 L1000 0
A CS:100
MOV AX,301
MOV BX,200
MOV CX,1
MOV DX,80
INT 13
INT 20
g
q
:BEGIN
Keep in mind this is not a substitute for wiping a hard drive. All it does is remove all the partition information.
Our process to diagnose a bad hard drive has you remove all hard drive partitions, FDISK the drive and make one large partition, restart and format the drive. Easy as pressing 1,2 and 3.
Now I guess you want to know how to integrate this in PXE? In your PXE configuration menu create a new menu item and name it DOS Menu. Choose your default settings and use the UNDI driver. You can take out the password on step 6 if you don't want unauthorized users getting into your express share.
At the step 8 there is an option to edit some files. We can call the GO.BAT from the startnet.bat file. Scroll down in the file and delete everything after %Altiris_Share%:
Add F: to make sure we are in the correct share and then add the line to call your batch file as we did here by adding call go.bat.
Save the changes and finish up creating your menu.
There you have it. Easy and simple way to utilize a DOS menu system for every day tasks. I have used this for a long time and it has saved a ton of typing.