Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
641 views
in Technique[技术] by (71.8m points)

command line - Hiding a simple batch window

I've searched this and some pages came which weren't really useful or were too complicated (I am not a skilled batch file programmer!)! What I need is to run a batch file in hidden form (no console window). The batch file will not be called from external application or code. It will be clicked on by the client and then I want no console pages to be shown (only pages which are called by call command should be shown)! The batch file is exactly 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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I use VBScripts to open it hidden, like this:

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

for e.g the bat file I want to run is run.bat then I'll do like this

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

Instead of running the batch file run the vb file.

Write it in notepad and save it as *.vbs


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...