WScript.Shell的使用问题

heywood 2005-06-03 07:39:40
WScript.Shell的使用问题

运行以下asp脚本,返回结果为ok

然后执行效果却没有?!

是在administrator的权限下运行的。。

请问要如何执行一个cmd呢?

<%
'Set WshShell = server.createobject("Wscript.Shell")
'WshShell.Run "d:\yhdo.bat",0,true
'WshShell.Run "net user wapjh 111111 /add /passwordchg:no",0,true

strOwner="heywood"
strVirtualDirectoryPath="d:\business\wapjh"
'strACLCommand = "cmd /c echo y| CACLS "
'strACLCommand = strACLCommand & strVirtualDirectoryPath
'strACLCommand = strACLCommand & " /g " & strOwner & ":C"

strACLCommand = "cmd /c net user wapjh 111111 /add /passwordchg:no"

Set objWSH = Server.CreateObject("WScript.Shell")
objRTC = objWSH.Run (strACLCommand , 0, True)

Set objWSH = Nothing


if Err.number=0 then response.write "OK"

%>
...全文
84 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
heywood 2005-06-04
  • 打赏
  • 举报
回复
服务器win2003
heywood 2005-06-04
  • 打赏
  • 举报
回复
使用了,还是不可以!
无论你说的服务器端还是客户端
butcher2002 2005-06-03
  • 打赏
  • 举报
回复
服务器端Set objShell = Server.CreateObject("WScript.Shell")


这样就可以了
butcher2002 2005-06-03
  • 打赏
  • 举报
回复
Sub OpenFile()
On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
objShell.Run "WORDPAD.EXE "&""""&filelist.Value&""""
End Sub

上面是在客户端操作

8,329

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 IIS
社区管理员
  • IIS
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧