CMD.exe, AD and Beeps

  • Thread starter Thread starter Adrian Marsh
  • Start date Start date
A

Adrian Marsh

All,

I'm writing login scripts for my AD W2K environment.

At the moment they are in normal .bat scripts using CMD.EXE

My problem is this,  if any of my scripts run apps (.exe files) that return an errorlevel > 0, then at the end of execution the PC beeps. Actually it repeats the beeps for the total number of times that an app has returned >0, eg If I run setup.exe 5 times, and Cancel the app 5 times, I get 5 beeps.  All the beeps are saved until my login.bat finishes.

So - how can I switch off the annoying beeps?

If I put a "set ERRORLEVEL=0" at the end of the scripts, it stills beeps.

Besides that, I'm happy with the scripts, so I don't want to have to learn another script language and re-write them.

Another alternative partial solution is if anyone knows a .exe file that can display window informational messages, along with say - an OK button.  The tool I'm using at the moment uses ERRORLEVEL to return the button pressed, 1=OK,2=Cancel, etc, but then that causes the above beeps... arrghh!

Adrian
 
Ok, Rewritten:

All,

I'm writing login scripts for my AD W2K environment.

At the moment they are in normal .bat scripts using CMD.EXE

My problem is this, if any of my scripts run apps (.exe files) that
return an errorlevel > 0, then at the end of execution the PC beeps.
Actually it repeats the beeps for the total number of times that an app
has returned >0, eg If I run setup.exe 5 times, and Cancel the app 5
times, I get 5 beeps. All the beeps are saved until my login.bat finishes.

So - how can I switch off the annoying beeps?

If I put a "set ERRORLEVEL=0" at the end of the scripts, it stills beeps.

Besides that, I'm happy with the scripts, so I don't want to have to
learn another script language and re-write them.

Another alternative partial solution is if anyone knows a .exe file that
can display window informational messages, along with say - an OK
button. The tool I'm using at the moment uses ERRORLEVEL to return the
button pressed, 1=OK,2=Cancel, etc, but then that causes the above
beeps... arrghh!

Adrian
 
I'm writing login scripts for my AD W2K environment.

At the moment they are in normal .bat scripts using CMD.EXE

My problem is this, if any of my scripts run apps (.exe files) that
return an errorlevel > 0, then at the end of execution the PC beeps.
Actually it repeats the beeps for the total number of times that an app
has returned >0, eg If I run setup.exe 5 times, and Cancel the app 5
times, I get 5 beeps. All the beeps are saved until my login.bat finishes.

So - how can I switch off the annoying beeps?

If I put a "set ERRORLEVEL=0" at the end of the scripts, it stills beeps.

Besides that, I'm happy with the scripts, so I don't want to have to
learn another script language and re-write them.

Another alternative partial solution is if anyone knows a .exe file that
can display window informational messages, along with say - an OK
button. The tool I'm using at the moment uses ERRORLEVEL to return the
button pressed, 1=OK,2=Cancel, etc, but then that causes the above
beeps... arrghh!

set ERRORLEVEL=0 does nothing useful. What do you expect it to do?

Post the script. Which applications does it run? How does it start them?
What are the client operating systems?

There are oodles of MSGBOX.EXE, MESSAGEBOX.EXE and the like utilities
around. The first two my search brought up were:
<http://www.paulsadowski.com/WSH/cmdprogs.htm> and
<http://claudiosoft.online.fr/msgbox.html>. Some CLIs have this built
in: see <http://jpsoft.com/help/msgbox.htm>. The easiest way would
probably be to construct a MsgBox/PopUp with VBS. Or use KiXtart.
 
I thought the SET ERRORLEVEL might clear the beeps, but it doesn't - any
idea how too? Its multiple scripts, so not easy to post. An example is:


.....
.....
rem execute installer:
rem (%1 being the .exe installer passed to the script)

%1
if not errorlevel 0 goto _error
echo Installed %1 OK >> %LOG%

:_error
rem end script, return to master.

Lets say the master script calls the above script 3 times, with 3
seperate .exe files, and they all return an errorcode > 0, then I would
hear 3 beeps when the master script finishes on the client. This
applies to the msgbox tools you list below too. So if I have 3 pop-ups
for 3 tools, then I could get 6 beeps...

I'm modifying the scripts now so that they don't use msgboxes unless
absolutlely necessary, I'll use "pop-up" dos windows to give a message
as to whats happening (like "Installing McAfee...") and start the
installer. So then the only time it'll beep is if theres been an
installer failure.

Once I've finished the initial deploy of the s/w, and have time, I plan
too look at the kixstart tools too.

Thanks for your help.

A.
 
Back
Top