关于执行客户端文件问题,急...高手请进,本人在线等待。

bluemoon0001 2003-10-15 11:53:15
代码如下:
<script language=vbscript>
set fso=CreateObject("Scripting.FileSystemObject")
set f=fso.GetFolder("D:\Program Files\shanda\泡泡堂\")
Set fc = f.Files
For Each f1 in fc
s = f1.name

if s="CA.exe" then
Set objShell=CreateObject("WScript.Shell")
objShell.Run "D:\Program Files\shanda\泡泡堂\CA.exe",1,FALSE
Set objShell = Nothing
isture="1"
end if
Next

</script>
在我机上执行,已通过if判断,就是objShell.Run "D:\Program Files\shanda\泡泡堂\CA.exe",1,FALSE 没有反应。我换成其它的非安装的可执行文件,完全没有问题,就是通过安装过后生成的可执行文件不行。谁能告诉我是怎么回事,还有后面的“1”和"false"这两个参数是什么意思。问题解决就散分。
...全文
57 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
bluemoon0001 2003-10-15
  • 打赏
  • 举报
回复
谢谢各位问题已解决,散分了。
孟子E章 2003-10-15
  • 打赏
  • 举报
回复
D:\Progra~1\shanda\泡泡堂\CA.exe
孟子E章 2003-10-15
  • 打赏
  • 举报
回复
objShell.Run "D:\Program Files\shanda\泡泡堂\CA.exe",1,FALSE

是因为里面空格的问题
hwkknd 2003-10-15
  • 打赏
  • 举报
回复
Microsoft Windows Script Host 2.0 Language Reference

--------------------------------------------------------------------------------

Run Method
Creates a new process that executes strCommand.

object.Run (strCommand, [intWindowStyle], [bWaitOnReturn])

Arguments
object

WshShell object.

strCommand

Environment variables within the strCommand parameter are automatically expanded.

intWindowStyle

Optional. Sets the window style of the program being run.

bWaitOnReturn

Optional. If bWaitOnReturn is not specified or FALSE, immediately returns to script execution rather than waiting for the process to end.

If bWaitOnReturn is set to TRUE, the Run method returns any error code returned by the application.

If bWaitOnReturn is not specified or is FALSE, the Run method returns an error code of 0 (zero).

Remarks
The following table lists the available settings for intWindowStyle:

intWindowStyle Description
0 Hides the window and activates another window.
1 Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
2 Activates the window and displays it as a minimized window.
3 Activates the window and displays it as a maximized window.
4 Displays a window in its most recent size and position. The active window remains active.
5 Activates the window and displays it in its current size and position.
6 Minimizes the specified window and activates the next top-level window in the Z order.
7 Displays the window as a minimized window. The active window remains active.
8 Displays the window in its current state. The active window remains active.
9 Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.
10 Sets the show state based on the state of the program that started the application.


Example
The following example runs Microsoft Notepad and opens the currently running script:

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("%windir%\notepad" & WScript.ScriptFullName)
The following example returns the error code from the executed application:

Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("notepad " & WScript.ScriptFullName, 1, TRUE)
See Also
Applies To: WshShell Object


--------------------------------------------------------------------------------
©2000 Microsoft Corporation. All rights reserved.

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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