Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vbscript VBS(Visual Basic脚本)运行程序隐藏/不可见_Vbscript - Fatal编程技术网

Vbscript VBS(Visual Basic脚本)运行程序隐藏/不可见

Vbscript VBS(Visual Basic脚本)运行程序隐藏/不可见,vbscript,Vbscript,我正在尝试运行一个程序(在本例中是Internet Explore),该程序从VB脚本隐藏/不可见 我找到了一个隐藏批处理文件的简单脚本,并尝试了它。它似乎不起作用,因为程序只是像平常一样弹出 以下是我目前的代码: CreateObject("Wscript.Shell").Run "iexplore.exe",0,True 它运行程序iexplore.exe,但不运行隐藏/不可见 我还从一个隐藏的批处理文件运行这个VBS文件。 批处理文件只执行以下操作: start Run.vbs 每个脚

我正在尝试运行一个程序(在本例中是Internet Explore),该程序从VB脚本隐藏/不可见

我找到了一个隐藏批处理文件的简单脚本,并尝试了它。它似乎不起作用,因为程序只是像平常一样弹出

以下是我目前的代码:

CreateObject("Wscript.Shell").Run "iexplore.exe",0,True
它运行程序iexplore.exe,但不运行隐藏/不可见

我还从一个隐藏的批处理文件运行这个VBS文件。 批处理文件只执行以下操作:

start Run.vbs
每个脚本/批处理文件的代码:

批处理文件:主文件启动VBS文件

@echo off
:start
start HideExecuteServerVBS.vbs (To Hide the ExecuteServerVBS.bat file when running)
timeout /NOBREAK /T 5
TASKKILL /IM iexplore.exe
timeout /NOBREAK /T 3
TASKKILL /IM iexplore.exe /F
timeout /NOBREAK /T 1800
goto start
隐藏执行服务器vbs.vbs

CreateObject("Wscript.Shell").Run "ExecuteServerVBS.bat",0,True
@echo off
C:\Windows\sysWOW64\csript.exe C:\Users\Admin\RunInternetProcess\vbscript.vbs
Set ie = CreateObject("InternetExplorer.Application")
ExecuteServerVBS.vbs

CreateObject("Wscript.Shell").Run "ExecuteServerVBS.bat",0,True
@echo off
C:\Windows\sysWOW64\csript.exe C:\Users\Admin\RunInternetProcess\vbscript.vbs
Set ie = CreateObject("InternetExplorer.Application")
vbscript.vbs

CreateObject("Wscript.Shell").Run "ExecuteServerVBS.bat",0,True
@echo off
C:\Windows\sysWOW64\csript.exe C:\Users\Admin\RunInternetProcess\vbscript.vbs
Set ie = CreateObject("InternetExplorer.Application")

是否有可能通过VB脚本(Visual Basic脚本)运行不可见的程序?

您需要以这种方式加载程序:

Set ie = CreateObject("InternetExplorer.Application")

' To make visible, uncomment the following line...
'ie.Visible = True

您需要以这种方式加载它:

Set ie = CreateObject("InternetExplorer.Application")

' To make visible, uncomment the following line...
'ie.Visible = True

看看这些方法:


看看这些方法:


因此,如果您收到ActiveX错误,则很可能是试图在服务器下运行此vbscript。服务器采用64位平台,不支持直接执行32位VBScript?是 啊如果是这样,下面是你需要做的

创建批处理文件: ExecuteServerVBS.bat

C:\windows\sysWOW64\cscript.exe C:\path\to\your\vbscript.vbs
将vbscript代码放在此处:

vbscript.vbs

Set ie = CreateObject("InternetExplorer.Application")
'Go crazy 
和繁荣。你完了

更新

更新文件
ExecuteServerVBS.vbs

@echo off
C:\Windows\sysWOW64\cscript.exe C:\Users\Admin\RunInternetProcess\vbscript.vbs > errorlog.log
On Error Resume Next
Dim ie 
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = False
'Perform IE functions here......
If err.number <> 0 then wscript.echo err.number & ":" & err.description
更新文件
vbscript.vbs

@echo off
C:\Windows\sysWOW64\cscript.exe C:\Users\Admin\RunInternetProcess\vbscript.vbs > errorlog.log
On Error Resume Next
Dim ie 
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = False
'Perform IE functions here......
If err.number <> 0 then wscript.echo err.number & ":" & err.description
出错时继续下一步
暗淡的
设置ie=CreateObject(“InternetExplorer.Application”)
可见=假
'在此处执行IE功能。。。。。。
如果err.number为0,则wscript.echo err.number&“:”&err.description

因此,如果您收到ActiveX错误,则很可能是试图在服务器下运行此vbscript。服务器采用64位平台,不支持直接执行32位VBScript?是 啊如果是这样,下面是你需要做的

创建批处理文件: ExecuteServerVBS.bat

C:\windows\sysWOW64\cscript.exe C:\path\to\your\vbscript.vbs
将vbscript代码放在此处:

vbscript.vbs

Set ie = CreateObject("InternetExplorer.Application")
'Go crazy 
和繁荣。你完了

更新

更新文件
ExecuteServerVBS.vbs

@echo off
C:\Windows\sysWOW64\cscript.exe C:\Users\Admin\RunInternetProcess\vbscript.vbs > errorlog.log
On Error Resume Next
Dim ie 
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = False
'Perform IE functions here......
If err.number <> 0 then wscript.echo err.number & ":" & err.description
更新文件
vbscript.vbs

@echo off
C:\Windows\sysWOW64\cscript.exe C:\Users\Admin\RunInternetProcess\vbscript.vbs > errorlog.log
On Error Resume Next
Dim ie 
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = False
'Perform IE functions here......
If err.number <> 0 then wscript.echo err.number & ":" & err.description
出错时继续下一步
暗淡的
设置ie=CreateObject(“InternetExplorer.Application”)
可见=假
'在此处执行IE功能。。。。。。
如果err.number为0,则wscript.echo err.number&“:”&err.description

我收到一个错误,“ActiveX组件无法创建对象:'InternetExplorer.Application'来源:Microsoft VBScript运行时错误”您是否在64位操作系统上?如果是,请尝试使用SysWow64文件夹中的WSCRIPT.EXE启动脚本。是的,我当前使用的是64位Windows 7。如何使用WSCRIPT.EXE启动脚本?有几种方法。一种方法是右键单击VBS文件,选择“打开方式”,然后导航到c:\windows\syswow64文件夹并从中选择WSCRIPT.EXE。我收到一个错误,“ActiveX组件无法创建对象:'InternetExplorer.Application'源:Microsoft VBScript运行时错误”您是否在64位操作系统上?如果是,请尝试使用SysWow64文件夹中的WSCRIPT.EXE启动脚本。是的,我当前使用的是64位Windows 7。如何使用WSCRIPT.EXE启动脚本?有几种方法。一种方法是右键单击VBS文件,选择“打开方式”,然后导航到c:\windows\syswow64文件夹并从中选择WSCRIPT.EXE。因此,“ExecuteServerVBS.bat”的代码将是“c:\windows\syswow64\script.EXE c:\path\to\my\vbscript.VBS”?因此,“ExecuteServerVBS.bat”的代码将是“C:\windows\sysWOW64\cscript.exe C:\path\to\my\vbscript.vbs”?是的。运气不好?vbscript信息页面中有关于在服务器上执行vbs的其他信息。顺便说一下,我没有运行服务器。由于某些原因,当它启动时,会在我当前所在的浏览器(不是默认浏览器,不是internet explorer)中打开一个新选项卡。因此“ExecuteServerVBS.bat”将是“C:\windows\sysWOW64\script.exe C:\path\to\my\vbscript.vbs”?因此,“ExecuteServerVBS.bat”的代码将是“C:\windows\sysWOW64\cscript.exe C:\path\to\my\vbscript.vbs””“是的。不走运?在vbscript信息页面中有关于在服务器上执行vbs的其他信息。顺便说一句,我没有运行服务器。由于某些原因,当服务器启动时,它会在我当前所在的浏览器(不是默认浏览器,不是internet explorer)中打开一个新选项卡。