DOS commands in HTML ?

W

Weyoun the Dancing Borg

PW said:
Is there a way to do this ...

echo ^G > LPT1

... from an HTML page ? or maybe an ASP ?

or echo format c:

?


dear god I hope that no one ever implements this.
 
R

Richard

PW said:
Is there a way to do this ...

echo ^G > LPT1

... from an HTML page ? or maybe an ASP ?

No.

Why would you want to print the contents of the hard drive?
 
M

Mitja

PW said:
Is there a way to do this ...

echo ^G > LPT1

... from an HTML page ? or maybe an ASP ?

God forbid.
If that were possible, you'd probably get a picture of naked women every
hour or so on the 'net. (depending on your interests).

What does this control character do? If it's a page break, there's something
in css. If not, please describe it further.
 
P

PW

Richard said:
No.
Why would you want to print the contents of the hard drive?


I wouldn't.

This DOS command ... echo ^G > LPT1 ... will send a chr(7), or BEL character
to a receipt printer I have connected to the clients PC. There is an
electronic cash drawer connected to the receipt printer. When the receipt
printer receives a chr(7)/BEL character, it kicks the cash drawer open.

I have tried sending chr(7) to the printer, but all it does is actually
print the little ASCII character, rather than ringing the BELL and opening
the drawer.

However, if I do exactly the same thing in DOS, the drawer opens correctly.

Therefore I need to perform a wscipt.shell command or equivilent to perform
the DOS function. I have tried every variation of the wscript.shell
command, and it won't run either a DOS batch file or a VBS script file.

I have scanned the web and this question is asked all over the place, but no
one seems to have a solution.
 
P

PW

Mitja said:
What does this control character do? If it's a page break, there's something
in css. If not, please describe it further.


This DOS command ... echo ^G > LPT1 ... will send a chr(7), or BEL character
to a receipt printer I have connected to the clients PC. There is an
electronic cash drawer connected to the receipt printer. When the receipt
printer receives a chr(7)/BEL character, it kicks the cash drawer open.

I have tried sending chr(7) to the printer, but all it does is actually
print the little ASCII character, rather than ringing the BELL and opening
the drawer.

However, if I do exactly the same thing in DOS, the drawer opens correctly.

Therefore I need to perform a wscipt.shell command or equivilent to perform
the DOS function. I have tried every variation of the wscript.shell
command, and it won't run either a DOS batch file or a VBS script file.

I have scanned the web and this question is asked all over the place, but no
one seems to have a solution.
 
M

Mitja

PW said:
This DOS command ... echo ^G > LPT1 ... will send a chr(7), or BEL
character to a receipt printer I have connected to the clients PC.
There is an electronic cash drawer connected to the receipt printer.
When the receipt printer receives a chr(7)/BEL character, it kicks
the cash drawer open.

I have tried sending chr(7) to the printer, but all it does is
actually print the little ASCII character, rather than ringing the
BELL and opening the drawer.

However, if I do exactly the same thing in DOS, the drawer opens
correctly.

Therefore I need to perform a wscipt.shell command or equivilent to
perform the DOS function. I have tried every variation of the
wscript.shell command, and it won't run either a DOS batch file or a
VBS script file.

I have scanned the web and this question is asked all over the place,
but no one seems to have a solution.

You definitely can't do that from a web page. As pointed out before: if you
could use an eqivalent of the shell() function, you could do _anything_ on
the user's computer.
 
R

Richard

PW said:
I wouldn't.

This DOS command ... echo ^G > LPT1 ... will send a chr(7), or BEL character
to a receipt printer I have connected to the clients PC. There is an
electronic cash drawer connected to the receipt printer. When the receipt
printer receives a chr(7)/BEL character, it kicks the cash drawer open.

I have tried sending chr(7) to the printer, but all it does is actually
print the little ASCII character, rather than ringing the BELL and opening
the drawer.

However, if I do exactly the same thing in DOS, the drawer opens correctly.

Therefore I need to perform a wscipt.shell command or equivilent to perform
the DOS function. I have tried every variation of the wscript.shell
command, and it won't run either a DOS batch file or a VBS script file.

I have scanned the web and this question is asked all over the place, but no
one seems to have a solution.


I see. You might try using cgi then or perhaps even php.
To my knowledge, you can not activate a dos command in html by itself.
If you're not needing to go online, and be purely local with the routine,
how about using a language called libertybasic?
www.libertybasic.com
It's basic, but designed to work with windows without leaving windows.
It has all the features of BASIC, plus some other goodies to make it more
applicable for writng stuff like games in windows.
The free version doesn't allow you to create "exe" files but for a small fee
you can get that.
 
T

Toby A Inkster

PW said:
Is there a way to do this ...

echo ^G > LPT1

... from an HTML page ?

If the HTML page is hosted on a local web server (i.e. the cash register
thing is directly attached to the web server) then you should be able to
to this pretty easily with server-side scripting.
 
M

Mitja

Toby A Inkster said:
If the HTML page is hosted on a local web server (i.e. the cash
register thing is directly attached to the web server) then you
should be able to to this pretty easily with server-side scripting.

Um... a grocer selling pickles and running Apache? :)
Could be sommething different, though
 
H

Hywel Jenkins

Mitja said:
Um... a grocer selling pickles and running Apache? :)

Why not? If there's already a computer there it's a short step to
installing a web server on it. Most POST terminals run some operating
system and have a shell, so compiling such software would be a
reasonably trivial task.
 
Joined
Jun 25, 2007
Messages
1
Reaction score
0
PW said:
Is there a way to do this ...

echo ^G > LPT1

.... from an HTML page ? or maybe an ASP ?


Set WScript = CreateObject("WScript.Shell")
WScript.Exec("C:\Windows\Command.com /C Echo ^G > LPT1")
:fight:
Exit

This will send the character to your printer. Whether it beeps or not I cannot predict!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top