How to run a DOS command from ASP

P

PW

How can I run a DOS command from my ASP ?

(prefer to use html/vbscript solution rather than 3rd party add-ons)
 
P

PW

Ray at said:
<%CreateObject("WScript.Shell").Run "%comspec /c copy C:\*.txt D:\" %>
See here:
http://msdn.microsoft.com/library/en-us/script56/html/wsmthrun.asp


I can't see anything happening.

Heres what I'm trying to do ...

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.
 
R

Ray at

The code I posted would run on the SERVER, not the client, as this is an ASP
group. The code would be the same for client-side scripting, though, and
would run if security settings are set to allow it in the browser.

Ray at work
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top