Batch Hide Run Hide the batch itself
@echo off
if "%1"=="h" goto begin
start mshta vbscript:createobject("").run("""%~nx0"" h",0)()&&exit
:begin
::The following is a normal batch command, and cannot contain interactive commands such as pause set/p
××××××××
explain:
This is a scripting language in mta. This control in Windows is created using VBScript. The batch process runs in the backend using the run method provided in this control. The mst scripting language is equivalent to an html application. No matter what scripting language is used, as long as the space provided by the windows system can be created, the run method in this space can be opened with the run method in this space. We can also use the JavaScript in the mta scripting language to perform as well. @echo off ::Batch hidden run if "%1"=="h" goto begin mshta "javascript:new ActiveXObject('').run('%~nx0 h',0);();"&&exit ::Code to run :begin echo OK pause>nul mta scripting language is actually basically the same as the html language. mta scripting language is parsed by mshta program, and html is parsed by browser (IE). It is recommended to look at the html scripting language and understand. This is not the scripting language in the format of vbs file. The vbs scripting file is parsed by wscript. Just remember to use mshta vbscript:createobject("plugin name")(). Here is the method in mshta itself, which is to close the program. Just create the plug-in provided by Windows in this format. You can understand the method in the plug-in by reading the following documentation. You can do something about the scripting language. HI Me
How to hide the batch operation window
This will not generate temporary files (compatible with space paths):
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("").run("%~fs0 h",0)()&&exit
:begin
Rem begins writing batch code below
Summarize:
Adding any of the following sentences under @echo off can achieve the effect of hiding execution, (the code tag is to hide the execution task)
The two codes have the same ideas and different implementation methods. Please experience them carefully:
if "%1"=="h" (goto code) else (mshta vbscript:createobject^(""^).run^("%~fs0 h",0^)^(^)&exit)
if exist # (del # &goto code) else (echo createobject^(""^).run "%~fs0",0 >#&start
#&exit)
This code will not flash the prompt
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("").run("%~nx0 h",0)()&&exit
:begin
Rem begins writing batch code below
.....
The last one:
if not "%1"=="h" mshta vbscript:createobject("").run("%~sf0 h %*",0)()&exit /b
shift /1 helped me
@echo off
if "%1"=="h" goto begin
start mshta vbscript:createobject("").run("""%~nx0"" h",0)()&&exit
:begin
::The following is a normal batch command, and cannot contain interactive commands such as pause set/p
pause
How to make batch files run hidden
if "%1" == "h" goto begin
mshta vbscript:createobject("").run("%~nx0 h",0)()&&exit
:begin
If you double-click a batch, it is equivalent to empty parameters, and some applications need parameters, such as entering shutdowm -s -t 0 in the cmd window, where -s -t 0 is the parameter. shutdown is %0, -s is %1, -t is %2, and so on.
Let's skip the first line first and look at the second line, which means using mshta to create a vbs program, with the content: createobject("").run(...). If the batch name of the running is, under C:\, %0 represents C:\, %~nx0 represents. h extreme parameter %1, 0 means hidden operation. Since you double-click to run, the first batch processing %1 is empty, if is not valid, and then run the next sentence. Then open yourself again and pass the parameter h. At this time if it is established, jump to begin and start running.
These two lines are classic and can make batches run without windows.
In addition, make a batch program to call the batch file to be executed.
My method is:
@echo off
start /min
Save the above code as:
After that, save your batch file as, open it before running, and then run it will be minimized.
Copy the codeThe code is as follows:
@echo off
if "%1"=="h" goto begin
start mshta vbscript:createobject("").run("""%~nx0"" h",0)()&&exit
:begin
::The following is a normal batch command, and cannot contain interactive commands such as pause set/p
××××××××
explain:
This is a scripting language in mta. This control in Windows is created using VBScript. The batch process runs in the backend using the run method provided in this control. The mst scripting language is equivalent to an html application. No matter what scripting language is used, as long as the space provided by the windows system can be created, the run method in this space can be opened with the run method in this space. We can also use the JavaScript in the mta scripting language to perform as well. @echo off ::Batch hidden run if "%1"=="h" goto begin mshta "javascript:new ActiveXObject('').run('%~nx0 h',0);();"&&exit ::Code to run :begin echo OK pause>nul mta scripting language is actually basically the same as the html language. mta scripting language is parsed by mshta program, and html is parsed by browser (IE). It is recommended to look at the html scripting language and understand. This is not the scripting language in the format of vbs file. The vbs scripting file is parsed by wscript. Just remember to use mshta vbscript:createobject("plugin name")(). Here is the method in mshta itself, which is to close the program. Just create the plug-in provided by Windows in this format. You can understand the method in the plug-in by reading the following documentation. You can do something about the scripting language. HI Me
How to hide the batch operation window
This will not generate temporary files (compatible with space paths):
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("").run("%~fs0 h",0)()&&exit
:begin
Rem begins writing batch code below
Summarize:
Adding any of the following sentences under @echo off can achieve the effect of hiding execution, (the code tag is to hide the execution task)
The two codes have the same ideas and different implementation methods. Please experience them carefully:
if "%1"=="h" (goto code) else (mshta vbscript:createobject^(""^).run^("%~fs0 h",0^)^(^)&exit)
if exist # (del # &goto code) else (echo createobject^(""^).run "%~fs0",0 >#&start
#&exit)
This code will not flash the prompt
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("").run("%~nx0 h",0)()&&exit
:begin
Rem begins writing batch code below
.....
The last one:
if not "%1"=="h" mshta vbscript:createobject("").run("%~sf0 h %*",0)()&exit /b
shift /1 helped me
@echo off
if "%1"=="h" goto begin
start mshta vbscript:createobject("").run("""%~nx0"" h",0)()&&exit
:begin
::The following is a normal batch command, and cannot contain interactive commands such as pause set/p
pause
How to make batch files run hidden
if "%1" == "h" goto begin
mshta vbscript:createobject("").run("%~nx0 h",0)()&&exit
:begin
If you double-click a batch, it is equivalent to empty parameters, and some applications need parameters, such as entering shutdowm -s -t 0 in the cmd window, where -s -t 0 is the parameter. shutdown is %0, -s is %1, -t is %2, and so on.
Let's skip the first line first and look at the second line, which means using mshta to create a vbs program, with the content: createobject("").run(...). If the batch name of the running is, under C:\, %0 represents C:\, %~nx0 represents. h extreme parameter %1, 0 means hidden operation. Since you double-click to run, the first batch processing %1 is empty, if is not valid, and then run the next sentence. Then open yourself again and pass the parameter h. At this time if it is established, jump to begin and start running.
These two lines are classic and can make batches run without windows.
In addition, make a batch program to call the batch file to be executed.
My method is:
Copy the codeThe code is as follows:
@echo off
start /min
Save the above code as:
After that, save your batch file as, open it before running, and then run it will be minimized.