Set WshShell = CreateObject("WScript.Shell") 
Author Message
 Set WshShell = CreateObject("WScript.Shell")

Hi,

I am executing the following code from an ASP page and it
is giving me this message "An exception of type 'Runtime
Error' was not handled. pointing to the second line in the
code below. I have VBScript 5.6 installed.

Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("d:\ftp_to_qa.bat")
WScript.Echo oExec.Status

Can someone help?

Thanks,



Wed, 06 Oct 2004 02:00:23 GMT  
 Set WshShell = CreateObject("WScript.Shell")
If you're using ASP you need to use the server object to call the
createobject method, so it should be:

server.createobject("Wscript.shell")



Wed, 06 Oct 2004 05:15:34 GMT  
 Set WshShell = CreateObject("WScript.Shell")

Quote:
> I am executing the following code from an ASP page and it
> is giving me this message "An exception of type 'Runtime
> Error' was not handled. pointing to the second line in the
> code below. I have vbscript 5.6 installed.

> Dim WshShell, oExec
> Set WshShell = CreateObject("WScript.Shell")
> Set oExec = WshShell.Exec("d:\ftp_to_qa.bat")
> WScript.Echo oExec.Status

WScript.Echo won't work from ASP, only when wscript/cscript is the host for the script.

If the error is on the CreateObject line, you may have installed the wrong OS version of WSH.  There are separate installs, one for Win2000 and one for Win98/ME/NT4...

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



Wed, 06 Oct 2004 06:52:34 GMT  
 Set WshShell = CreateObject("WScript.Shell")
Thanks, for the info I no longer get the error. Now I try
to simply execute a bet file to del a file and it will not
delete it. If I execute "calc.exe" it pop ups. Would you
know why this is the case. I thought by asking the bat
file to delete a file it would. My actual goal is to FTP a
file from one server to another via ASP.

Thanks,

Quote:
>-----Original Message-----
>> I am executing the following code from an ASP page and
it
>> is giving me this message "An exception of type 'Runtime
>> Error' was not handled. pointing to the second line in
the
>> code below. I have vbscript 5.6 installed.

>> Dim WshShell, oExec
>> Set WshShell = CreateObject("WScript.Shell")
>> Set oExec = WshShell.Exec("d:\ftp_to_qa.bat")
>> WScript.Echo oExec.Status

>WScript.Echo won't work from ASP, only when

wscript/cscript is the host for the script.
Quote:

>If the error is on the CreateObject line, you may have

installed the wrong OS version of WSH.  There are separate
installs, one for Win2000 and one for Win98/ME/NT4...
Quote:

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

>.



Sat, 09 Oct 2004 04:49:13 GMT  
 Set WshShell = CreateObject("WScript.Shell")

Quote:
> Thanks, for the info I no longer get the error. Now I try
> to simply execute a bet file to del a file and it will not
> delete it. If I execute "calc.exe" it pop ups. Would you
> know why this is the case. I thought by asking the bat
> file to delete a file it would. My actual goal is to FTP a
> file from one server to another via ASP.

Whatever you WshShell.Run is going to execute in the security context that ASP is running under.  If you allow anonymous access, that will be IUSR_machinename or IWAM_machinename.  These accounts don't (and shouldn't) have the power to do very much on the server.

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



Sat, 09 Oct 2004 05:09:22 GMT  
 Set WshShell = CreateObject("WScript.Shell")
When I FTP I have a specific userid and pwd that allows me
to create files to y destination server. If I provide NTLM
security to access the ASP page then would the
Wshshell.run have the security rights? If not how can this
be accomplished?

Thanks,

Quote:
>-----Original Message-----
>> Thanks, for the info I no longer get the error. Now I
try
>> to simply execute a bet file to del a file and it will
not
>> delete it. If I execute "calc.exe" it pop ups. Would you
>> know why this is the case. I thought by asking the bat
>> file to delete a file it would. My actual goal is to
FTP a
>> file from one server to another via ASP.

>Whatever you WshShell.Run is going to execute in the

security context that ASP is running under.  If you allow
anonymous access, that will be IUSR_machinename or
IWAM_machinename.  These accounts don't (and shouldn't)
have the power to do very much on the server.
Quote:

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

>.



Sat, 09 Oct 2004 08:05:18 GMT  
 Set WshShell = CreateObject("WScript.Shell")


Fri, 19 Jun 1992 00:00:00 GMT  
 Set WshShell = CreateObject("WScript.Shell")
I needed an ASP page to access a network share that the IUSR couldn't
see

MS site says various things about password synchronisation but couldn't
get that to work between NT and Netware

was advised that the iusr can get temporary increased access - call a
batch file via ASP scripting and use a "net use" in the batch file - can
map the unc resource as a user who does have access

works fine on IIS 5 - does anyone know the equivalent methods to "net
use" for a vb dll component?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 09 Oct 2004 22:10:37 GMT  
 Set WshShell = CreateObject("WScript.Shell")
Rob,

Have you setup an NTGATEWAY group on the Novell server, if not search the KB
for NTGATEWAY:
http://support.microsoft.com

You should be able to use the WNetAddConnection API to map to a Novell
share:

Public Declare Function WNetAddConnection Lib "mpr.dll" Alias
"WNetAddConnectionA" (ByVal lpszNetPath As String, ByVal lpszPassword As
String, ByVal lpszLocalName As String) As Long

Gordon Bell


I needed an ASP page to access a network share that the IUSR couldn't
see

MS site says various things about password synchronisation but couldn't
get that to work between NT and Netware

was advised that the iusr can get temporary increased access - call a
batch file via ASP scripting and use a "net use" in the batch file - can
map the unc resource as a user who does have access

works fine on IIS 5 - does anyone know the equivalent methods to "net
use" for a vb dll component?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 09 Oct 2004 22:43:19 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Set WSHShell = WScript.CreateObject("WScript.Shell")

2. problem with >> Set WshShell=CreateObject("Wscript.Shell")

3. can't CreateObject("Wscript.Shell")

4. How to use CreateObject("wscript.shell").run( "some.exe")

5. CreateObject("Excel","//server"), MsgBox output

6. Set filesys = CreateObject("Scripting.FileSystemObject")

7. Set fs = CreateObject("Scripting.FileSystemObject")-error

8. Set fso = Server.CreateObject("Scripting.FileSystemObject")

9. Set filesys = CreateObject("Scripting.FileSystemObject")

10. WScript.CreateObject("WScript.Shell") fails on NT 4.0

11. WScript.WshShell or WScript.Shell ??????

12. I cannot use WScript.CreateObject("MSWinsock.Winsock","Tcp1_") in .hta

 

 
Powered by phpBB® Forum Software