Running WSH script from ASP page - problem 
Author Message
 Running WSH script from ASP page - problem

Hello,

I am trying to run a .vbs file from a web page written in ASP.

I am using the following code snippet:-

set objShell = Server.CreateObject("Wscript.Shell")
objShell.Run "cscript \\Web02\scripts\createPage.vbs > \\Web02\CMS\result.log", 5, True

My problem is that the script never executes.

However, if I double click on the script, or when I call the command  cscript \\Web02\scripts\createPage.vbs > \\Web02\CMS\result.log
straight from the command prompt it works fine.

Any helpful ideas? Perhaps I should be calling the createPage.vbs file from it's physical location using drive letters, or a domain location?

Thanks in advance,
Natacha

**********************************************************************

Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...



Sat, 18 Dec 2004 00:49:52 GMT  
 Running WSH script from ASP page - problem

Quote:

> Hello,

> I am trying to run a .vbs file from a web page written in ASP.

> I am using the following code snippet:-

> set objShell = Server.CreateObject("Wscript.Shell")
> objShell.Run "cscript \\Web02\scripts\createPage.vbs > \\Web02\CMS\result.log", 5, True

> My problem is that the script never executes.

> However, if I double click on the script, or when I call the command
> cscript \\Web02\scripts\createPage.vbs > \\Web02\CMS\result.log
> straight from the command prompt it works fine.

> Any helpful ideas? Perhaps I should be calling the createPage.vbs
> file from it's physical location using drive letters, or a domain
> location?  

Q207671 - HOWTO: Accessing Network Files from IIS Applications
http://support.microsoft.com/support/kb/articles/Q207/6/71.ASP

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--



Sat, 18 Dec 2004 01:36:50 GMT  
 Running WSH script from ASP page - problem
It is a security issue. By default, the ISUR_<MACHINENAME> account was
impersonated and the token generated by the IIS was a Network token, which
is NOT allowed to access network resources.

Please check the article Michael provided. I believe it will give you a
clear understanding on the security of IIS.

Gary

This posting is provided "AS IS", with no warranties, and confers no
rights. Enjoyed ASP.NET? http://www.asp.net



Sat, 18 Dec 2004 15:13:26 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Problem Running WSH from ASP Page

2. Run an ASP page with WSH ?

3. Unable to run Wsh from Asp page

4. Running WSH from ASP Page - at command

5. Problem Running exe on server from ASP page

6. Running WSH Script From ASP

7. Howto run a vbs script from asp page?

8. Help running an Script using ASP pages

9. Running a script from and ASP page

10. PROBLEM WHEN WSH SCRIPT RUN -HELP PLEASE-

11. When developing an ASP page, Can you use a WSH Script

12. run WShell.Run in ASP page w/o path

 

 
Powered by phpBB® Forum Software