Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASPExec Not opening vbs file

Status
Not open for further replies.

cruford

Programmer
Dec 6, 2002
138
US
I have a vbscript I run now that I can pass in the IP as an argument and it will connect to any user on the fly. It works great.

Code:
WScript.Echo "Made it to the pca.vbs"
Dim wShell, oArgs
Set oArgs = WScript.Arguments
Set wShell = CreateObject("WScript.Shell")
sIP = oArgs.Item(0)
sCMD = """C:\Program Files\Symantec\pcAnywhere\AWREM32.EXE"""
sCMD = sCMD & """\\XXXXXX\[URL unfurl="true"]wwwroot\testsite\Information_Technology\template.CHF"""[/URL]
sCMD = sCMD &  """/C"
sCMD = sCMD & sIP
wShell.Run sCMD,9,False
Set wShell = Nothing

The first line is testing with ASPExec to see if I can even get the vbs to execute, so far it does not work. Here is the code on my asp page

Code:
<%'This below is still not working right, the call comes back ok but never launches the app.
If Request.querystring("IP") <> "" Then
  Set Executor = Server.CreateObject("ASPExec.Execute")
  Executor.Application = "cscript c:\batch\pca.vbs" 'this file is located on the users local drive
  Executor.Parameters = Request.QueryString("IP")
  Executor.ShowWindow = True
  Response.Write "Attempting to Execute " & Executor.Application & "<br>"
  strResult = Executor.ExecuteWinApp
  Response.Write "The result of this call was: " & strResult
  Response.Write "<br>Arguments: " & executor.parameters
End If
%>

The response I get is "OK" which tells me the script executed but I didn't get the echo and pcAnywhere doesn't start. I went through and made sure the dll was registered and that "Allow this service to interact with the desktop" was on in the I also created the new COM+ object on my Win 2k server. I have tried executing another app like notepad.exe and it shows up in the processes on my IIS server but never displays on the client side. What could I be missing or doing incorrectly? Thanks in advance.
 
Remember that the default IIS user is not necesarally the same user your logged in as. So when you execute something like notepad it is being executed by user IUSR_machinename who doesn't have a desktop at the moment to look at it.
It may be possible that starting PCAnywhere with IUSR_machinename is either causing a permissions issue or a default setup issue (since many apps depend on the user name who starts them to decide what their startup conditions are).

Just some ideas,
-T

barcode_1.gif
 
I have a simliar issue. I need to launch a .vbs script i created from a web front end. I see your point about user permissions and such being the IIS credentials will have to be able to execute on the server, right?

Is there a way for me to make this iis application have credentials to execute in the directory necessary and a method simliar to above use these credentials to execute/start my script? Thanks!
 
Ok the script executes now but it is starting on the server not on the client. I thought ASPexec was supposed send the command back to the client. Now when I click my button pcAnywhere starts on the server desktop and open the host connection. Why is it not sending that back to the client?

Here is the setup:

- starts up with local system account and has access to interact with the local desktop.

- IIS Server running on Win 2k server. This site has anonymous access turned off and is using windows NT authentication.

I can see the issue with the permissions being messed up but I'm at a point now I can't see the trees through the forest. I don't know what I need to change to fix this.
 
ASP runs on the server, therefore anything that ASP executes is executed on the server. In order to execute something on the client you would have to create an ActiveX control or something like that and run it on the Client's machine via client-side javascript or VBScript. Even then standard security may block it from executing something outside of the browser.

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top