wshshell.run

P

Paul Bergson

I'm trying to start up a command from inside my asp code to modify
permissions on folders. When I do I get the error

Microsoft VBScript runtime error '800a01a8'

Object required: ''

/newuser.asp, line 120



Line 120 is the WshShell.Run strWShell This works fine in vb script.
I'm not very savvy with asp so I'm unclear as to why I'm getting this error?


'Create Folder Skeleton
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''
''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''
Set FS = CreateObject("Scripting.FileSystemObject")
Set WSHNetwork = CreateObject("WScript.Network")

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



FS.CreateFolder(ParentDir & strName)
'Build Domain Admins

On Error Goto 0

strWShell = "\\admin04\bin\xcacls " & ParentDir & strName & " /G " &
txtQuote & "GOB\Domain Admins" & txtQuote & ":F /Y"
WshShell.Run strWShell


Any help is appreciated.
 
M

Mark Rae

Line 120 is the WshShell.Run strWShell This works fine in vb
script.
I'm not very savvy with asp so I'm unclear as to why I'm getting this
error?

Are you actually talking about "classic" ASP, i.e. not ASP.NET?
 
S

Steve C. Orr [MVP, MCSD]

Web pages do not have this level of security permissions by default.
If web pages could run anything they wanted on a users machine, that would
be quite a security hole, don't you think?
You can only get this to work in IE if each browser has customized security
options that allow it to work.
 
P

Paul Bergson

Yet this is classic and I'm trying to get it to run it on the server side.
I'm not even sure if it is possible.

--

Paul Bergson MCT, MCSE, MCSA, CNE, CNA, CCA

This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Paul Bergson

I'm trying to get this to run on the server side. Should have nothing to do
with the client
 
S

Steve C. Orr [MVP, MCSD]

OIC, well you still may be having permission issues. Make sure the ASPNET
user account has permission to access the file, or use impersonation to have
it run under another user account.
And you probably shouldn't be using scripting. This is ASP.NET and there
are better ways, such as the Process namespace:

Dim csc As System.Diagnostics.Process = New System.Diagnostics.Process()
csc.StartInfo.FileName = "c:\SomePath\MyCommandLineApp.exe"
csc.Start()

Here's more info:
http://msdn.microsoft.com/library/d...rfsystemdiagnosticsprocessclassstarttopic.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
 
P

Paul Bergson

Ok I can get a program to fire off but I can't pass it parameters. Sorry I
don't have any experience in this arena and I'm struggling at best. Is
there a way to start up a program and have parameters to go with it? When I
build the filename with parameters it breaks when I run without parameters
it works.


Thanks for your advice
--

Paul Bergson
 

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

Top