Hide a simple batch window

I was looking for this, and some pages appeared that were not very useful or too complicated (I am not an experienced batch file programmer!)! I need to run the batch file in a hidden form (without a console window). A batch file will not be called from an external application or code. The client will click on the client, and then I do not want to show the console pages (only the pages called by the call command should be displayed)! The batch file is as follows:

@echo off call setup.exe IF EXIST "C:/caillog" goto tracking IF NOT EXIST "C:/caillog" goto end :tracking call dotnet4.exe call ClientService.msi goto end :end 
+8
command-line windows cmd batch-file
source share
2 answers

I use VBScripts to hide it, for example:

 Set objShell = WScript.CreateObject("WScript.Shell") objShell.Run("%batchfile%"), 0, True 

for example, the bat file I want to run is run.bat , then I will do like this

 objShell.Run("run.bat"), 0, True 

Instead of running the batch file, run the vb file.

Write it in a notebook and save as * .vbs

+11
source share

As others have said, use VBS.

 Set WinScriptHost = CreateObject("WScript.Shell") WinScriptHost.Run Chr(34) & "C:\FilePath" & Chr(34), 0 Set WinScriptHost = Nothing 

This is what I use.

0
source share

All Articles