Jump to content
Can't remember your login details? Read more... ×
Johbremat

Run Batch File Silently.

Recommended Posts

Running a development machine with a stack of language platforms, frameworks, databases and application servers.

 

Everything bar Glassfish runs as a service.

 

At the moment I have a batch file in the Windows startup directory, and when the OS starts up it shows the CLI window executing the script.

 

Anyone have an idea on how to get the batch to execute silently? Not @ECHO OFF, but having the script run without even the CLI window showing.

Share this post


Link to post
Share on other sites

Search term I used didn't pull that up: cheers.

 

Anyone else with an offer? I'd rather not start faffing about with VBScript if it can be helped (regardless of whether a solution is simple or not).

Share this post


Link to post
Share on other sites

@Pappes: cheers for the heads up. I'll give it a go once I hit the machine again.

 

@TheSecret: why do you ask?

Because I don't see how the visibility affects anything except as a security measure, and if you have a good security policy it should not matter.

Share this post


Link to post
Share on other sites

I know what you mean by it, and it is possible. I had to write an .exe to start my application around 2 years back and it was at least effective as a single command (i meant /C at the end) but i had plenty of trouble with it. Short of int winmain or int dllmain i cannot remenber but i'll see if i can dig out what i found.

NB or PS . Microsoft gave up supporting batch around 95/98 in favour of WSH Windows Script Host.

Use exec() function p/command and it will not spring a console, WSH is considered the correct action since 98.

Share this post


Link to post
Share on other sites

AHHHH! new that was around somewhere!

batch is a bit screwed for some of its obscurities.

Try this line at the top of your .bat

 

@Echo Off && CLS && COLOR F9 && MODE 13,1

 

13,1 appears to be as small as it will go in XP, but you cannot resize it.

 

oops! had to edit here, i forgot the royalties...

http://www.msfn.org/board/Tool-Hide-consol...40&start=40

 

and

take a look at

CMD /? > C:\cmd-info.txt

 

Heres one with other interpretations using the OS user config

for batch and WSH

http://www.winhelponline.com/blog/run-bat-...command-prompt/

Share this post


Link to post
Share on other sites

i had a similar problem a years ago when writing a quick VB6 app in high school. the easiest fix was to create a vb script (.vbs) to cloak it. depending on exactly what your doing it might suffice, very effective. very easy and not messy no matter how skeptical you are of anything with vb in the name.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×