Silencing the bell

  • Thread starter Thread starter Csaba Gabor
  • Start date Start date
C

Csaba Gabor

Is there any way I can temporarily suppress the bell?

Motivation:
If I want to schedule a task with schtasks, then I might enter
something like:
schtasks /Create /RU Gabor /SC Once /SD 01/20/2006 /ST 12:13:14 /TN
test /TR "dir"

Then there will be a loud bell and the text:
Please enter the run as password for Gabor:

Now this is all well and good and I can avoid this bell and text by
placing /RP "password" onto the calling line, but when I was first
working it out, I was piping in that password (echo password|...) and
it was all working fine except that you could hear the bell even though
the Cmd window under the automation never appeared. So this question
is left over from my development process.

By the way, it is possible to insert double quotes within the /TR
arguments by escaping them with a backslash (I've inserted nested
levels on my Win XP Pro system).

Regards,
Csaba Gabor from Vienna
 
Csaba said:
Is there any way I can temporarily suppress the bell?

Motivation:
If I want to schedule a task with schtasks, then I might enter
something like:
schtasks /Create /RU Gabor /SC Once /SD 01/20/2006 /ST 12:13:14 /TN
test /TR "dir"

Then there will be a loud bell and the text:
Please enter the run as password for Gabor:

Now this is all well and good and I can avoid this bell and text by
placing /RP "password" onto the calling line, but when I was first
working it out, I was piping in that password (echo password|...) and
it was all working fine except that you could hear the bell even though
the Cmd window under the automation never appeared. So this question
is left over from my development process.

I can't duplicate the sound you're experiencing. My Schtasks command
doesn't beep.

FWIW, if you're going to do this a lot, I recommend not echoing the
password in plain text in your script, and use EditV32.exe instead. You
can use it you ask for the password once, store it in an environment
variable, and re-use it multiple times in the script without having to
pipe it each time. This is a bit more secure than writing the password
in plain text in the script, and less annoying than prompting for the
password multiple times.

http://www.cybermesa.com/~bstewart/editv.html
By the way, it is possible to insert double quotes within the /TR
arguments by escaping them with a backslash (I've inserted nested
levels on my Win XP Pro system).

I don't think so. At least, I've never been able to find an escape
character that works. AFAIK, this isn't possible unless you create a
shell script and schedule the script.
 
Bill said:
....
I can't duplicate the sound you're experiencing. My Schtasks command
doesn't beep.

Interesting. Thanks for checking it out. Hmm. Possibly system events
are mapped differently (or maybe I could programmatically diddle the
volume control).
FWIW, if you're going to do this a lot, I recommend not echoing the
password in plain text in your script, and use EditV32.exe instead.

I agree: embedding passwords in script is a serious security hold.
What I was doing was for testing purposes. Actually, any task with
elevated security privileges is a security risk if the task files can
be overwritten!

....
I don't think so.

Do you have PHP installed? I can show you a working demo
At least, I've never been able to find an escape
character that works. AFAIK, this isn't possible unless you create a
shell script and schedule the script.

Csaba
 
Back
Top