为您找到"
set wshshell nothing
"相关结果约100,000,000个
Set WshShell = CreateObject("WScript.Shell") WshShell.Run chr(34) & "C:\Batch Files\syncfiles.bat" & Chr(34), 0 Set WshShell = Nothing Unfortunately, when I schedule this script, it does the job but returns instantly, making Windows scheduler think the task is finished when in reality the BAT is just running off by itself somewhere.
Use a VB Script to call the batch file ... Set WshShell = CreateObject("WScript.Shell" ) WshShell.Run chr(34) & "C:\Batch Files\ mycommands.bat" & Chr(34), 0 Set WshShell = Nothing Copy the lines above to an editor and save the file with .VBS extension. Edit the .BAT file name and path accordingly. Then just run the .vbs file and the magic happens!
Set WshShell = CreateObject ("WScript.Shell") WshShell.Run chr (34) & "C:\Batch Files\syncfiles.bat" & Chr (34), 0 Set WshShell = Nothing I need some detailed help here in explaining these lines of commands, so I can understand how to use them better. Thanks in advanced
Set WshShell = CreateObject("WScript.Shell") WshShell.Run chr(34) & "schedule.bat" & Chr(34), 0 Set WshShell = Nothing ... to the following should help:
Dim WSHShell Set WSHShell = Wscript.CreateObject("WScript.Shell") WSHShell.Run "\\stl-nt-5\Package$\LANDesk\Agents\WKS_Standard_SP3_20120321_with_status.exe", 3, True OK, I think I fixed that but it still does not work: Line 7 char 1 "system cant find the file specified, but I can run it from the run line or command prompt My new ouput Code ...
There is no way to do this with a batch file alone. however if you truly require your batch file to not popup a window you can create and run the following vbs script to do exactly what you want Set WshShell = CreateObject ("WScript.Shell" ) WshShell.Run chr (34) & "yourfile.bat" & Chr (34), 0 Set WshShell = Nothing Copy the lines above to Notepad and save the file with . VBS extension. Now ...
Set WshShell = WScript.CreateObject ("WScript.Shell") WshShell.Run "c:\progra~1\citrix\icacli~1\pn.exe /APP desktop", 1, True Set WshShell = Nothing I have tried a wait command, but what happens is that it only thinks the .exe is kicking off only one process, so it doesn´t care about the other process and decides to go to the next line of code.
When I try to run this script it pops up with a error message from Windows Script Host saying I need the object WshScript and I don't know how to fix it. Any help would be great. Set WshShell = WScript.CreateObject…
Set WshShell = CreateObject("WScript.Shell") WshShell.Run chr(34) & "C:\mycommand_path\mycommand and args" & Chr(34), 0 Set WshShell = Nothing create a shortcut to this file and run this from the shell directly by double clicking it. It sounds like what you are really after is job control.
The vbs file would be this in order to run the PS1 hidden StartBU_StorSpaceStat.vbs Code: Set WshShell = CreateObject("WScript.Shell") WshShell.Run "Powershell.exe -File " & chr(34) & "D:\Computer\Scripts\BU_StorSpaceStat.ps1" & Chr(34), 0 Set WshShell = Nothing If I wanted the PS1 to run minimised instead, I'd use StartBU_StorSpaceStat.vbs Code: