shellexecute in ASP?

Posted on 2003-03-26
Medium Priority
Last Modified: 2008-03-17
Is it possible to call shellexecute in ASP? If yes, how? Normally i would do the following for VB:

myResult = ShellExecute(Me.hwnd, "print", filename, vbNullString, "", SW_HIDE)
Question by:babypris
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Expert Comment

ID: 8214022
Private Sub Shell(byVal command)
     dim wshShell, boolErr, strErrDesc
     On Error Resume Next
     Set wshShell = CreateObject("WScript.Shell")
     wshShell.Run command
     if Err Then
          boolErr = True
          strErrDesc = Err.Description
     end if
     Set wshShell = Nothing
     On Error GoTo 0
     if boolErr then Err.Raise 5105, "Shell Statement", strErrDesc
End Sub

Expert Comment

ID: 8214028
But not sure about the print function though.
LVL 14

Accepted Solution

aelatik earned 40 total points
ID: 8214213

I don't know what you want to accomplish but the code [hansamryan] gave you will execute on server and not client side.

If you want your code to execute ( SHELL for example ) client side you must use active X controls.

Author Comment

ID: 8214264
It's ok. I found the answer. thanks anyway...

Dim oWSHShell

Set oWSHShell = WScript.CreateObject("WScript.Shell")

oWSHShell.Run "Rundll32.exe MSHTML.dll,PrintHTML " & _
                 filename, 1, true

Author Comment

ID: 8214416
how do you use active x?

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question