if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
cd E:\guokySVN\资料\技术\6. ETL\02.kettle\安装包\pdi-ce-4.0.0-stable\data-integration
Kitchen.bat /file E:\KETTLE_TEST\TEST5\mysqljob1.kjb /level:Basic>>E:\KETTLE_TEST\TEST5\mysqljob1.log
新建一个记事本,里面输入:
CreateObject("WScript.Shell").Run "cmd /c D:/test.bat",0
其中 D:/test.bat 是 bat 文件的绝对路径
将此新建的记事本保存为 vbs 格式文件。
以后执行这个 vbs 文件即可。
转载自批处理隐藏自身窗口大多数时候,使用批处理执行一些任务。但是批处理的黑色命令窗口会一直存在很烦人。可以通过两种方式,隐藏bat脚本。方法1:直接在 bat 文件最前边加上以下内容:@echo off if "%1" == "h" goto begin mshta vbscript:createobject("wscript.shell").r
set ws=WScript.CreateObject("WScript.Shell")
ws.Run "d:\yy.bat",0
另存为vbs文件即可,其中d:\yy.bat是你需要运行的bat文件的路径。
方法二:用文本文档打开bat文件,在开头处写入
@echo off
if "%1" == "h" goto beg...
想让bat运行时
隐藏
cmd
窗口
,最好的方法是使用vbs文件实现,
1、新建一个文本文档,改名为123.vbs,编辑内容:
set ws=WScript.CreateObject("WScript.Shell")
ws.Run "yy.bat",0
yy.bat是同目录下的
批处理
文件。双击123.vbs,即可运行
批处理
文件,但没有cmd
窗口
弹出。缺点:这种方法可以
隐藏
cmd
窗口
,...
源地址:http://www.cn-dos.net/forum/viewthread.php?tid=23846&fpage=1&highlight=%E9%9A%90%E8%97%8F%E8%BF%90%E8%A1%8C
1.基础HideRun.vbs
CODE:[Copy to clipboard]
CreateObject("WScript....
其第一个参数相当于system函数的参数,第二个参数可以设置
窗口
是否显示,SW_HIDE这个宏表示
隐藏
窗口
,例如:
WinExec(cmd.c_str(),SW_HIDE);//cmd(string类型)中为我们要调用的程序名及其参数, 如 “dir *.exe ”
但是这个有一个问题,这个函数创建...
set ws=WScript.CreateObject("WScript.Shell")
ws.Run "D:\test.bat /start",0
保存,然后放到Windows启动目录下,就可以了。
2.
隐藏
运行
窗口
bat运行后一般会有一个黑色的命令
窗口
,那么如何
隐藏
呢?有两种方式:
IF "%1"=="" for %%c in (c:\appsoft\apply\*.dll) do regsvr32.exe /s %%c
IF "%1"=="" for %%c in (c:\appsoft\apply\*.ocx) do regsvr32.exe /s %%c
IF not "%1"=="" for %%c in (%1\appsoft\apply\*.dll) do ...
[url]http://zhidao.baidu.com/question/33132161[/url]
新建记事本,输入:
CreateObject("WScript.Shell").Run "cmd /cE:\run.bat",0
然后保存.修改后缀名.txt为.vbs,然后双击这个文件
那么调用E盘下的run.bat的时候,dos
窗口
就
隐藏
窗体了!
方法二...
if "%1"=="h" goto begin
start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
rem 这里写正式的
批处理
代码,注意不要用pause之类的,否则一直关不掉的
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.gid
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
但是会闪一下
2.第二种方法(...
for i = 1:length(hWnds)
% 获取
窗口
标题
title = matlab.desktop.internal.getWindowTitle(hWnds(i));
% 如果
窗口
标题包含指定的关键字,就将
窗口
最小化
if contains(title, '关键字')
matlab.desktop.internal.setWindowMinimized(hWnds(i), true);
请将代码中的“关键字”替换为您需要
隐藏
的
窗口
的标题中包含的关键字。