Jump to content

[Release] cmdhide.exe


Siginet

Recommended Posts

This small tool is useful for hiding ugly cmd windows.

It might not be quite as effective as cmdow.exe but cmdow.exe is now triggered by antivirus programs as a virus. cmdow.exe is not a virus... but since the AV makers decided to destroy cmdow.exe I came up with this alternative.

It works a little diffrently than cmdow. Here is how you use it:

Most people will want to place the cmdhide.exe file in the system32 directory so they don't have to specify the path to cmdhide.exe in their batch files.

There are 2 ways to use it.

1. Hide one Batch File

Let's say you want to hide only one batch file. The batch file you want to hide is the batch you are going to start. In this case you would want to call cmdhide.exe with the title of the batch window. So somewhere in your batch you need to make a Title for the batch window like this:

Title MyBatchWindow

So now your Window Title is "MyBatchWindow"

Now in your batch you will want to call cmdhide.exe with the window title like this:

Title MyBatchWindow
cmdhide /name:MyBatchWindow

*Make sure you put your window title between quotes if it has spaces in it.

Now when the batch starts you will see the cmd window for a second then it will dissapear. :)

2. Hide batches called from other scripts

This is my favorite and will probably be the most used because it never flashes the batch window at all. It is hidden from the get go. Also it is very simple to do.

From within your main script if you are gonna call any batch windows you want to hide all you have to do is call cmdhide.exe with the path to the batch you want to hide.

Example:

cmdhide "X:\path\to\mybatch.bat"

v1.3

1. Bug fixed when run without path.

v1.2

1. Fixed bug where Environment Variables were not parsed.

2. Fixed bug where if path was not given the batch was not run.

v1.1

1. Fixed bug where if the path is not given an error would occur.

2. If file does not exist an error would occur... now there will be no indication at all.

Edited by Siginet
Link to comment
Share on other sites


Looks good but I had a problem using it.

It uses full paths only like

cmdhide C:\batch.bat

when trying to call a batch from in the same directory like

cmdhide batch.bat

it gave this error.

post-94394-1152325656_thumb.jpg

Link to comment
Share on other sites

Thanks for reporting that. I have fixed it now. :D I also fixed the instructions on how to use it within your batch file. I forgot to mention you needed to use cmdhide /name:"MyWindowTitle"

Link to comment
Share on other sites

No more error message but the batch file is not called.

and another "bug".

I can't use environmental variables like %systemdrive% either.

So the path to the batch must be an absolute path.

Unfortunately this will not work in unattended situations where drive letters are variable like in a RunOnceEx file.

Is it possible to add these features?

thanks again.

Edited by jaws75
Link to comment
Share on other sites

No more error message but the batch file is not called.

and another "bug".

I can't use environmental variables like %systemdrive% either.

So the path to the batch must be an absolute path.

Unfortunately this will not work in unattended situations where drive letters are variable like in a RunOnceEx file.

Is it possible to add these features?

thanks again.

Yes I will fix these issues as well.

Are you sure the batch is not called? What are the exact ways you are testing it?

Thanks for the reports! :D It helps a lot when people actually reply and help out.

I will be back on monday and I will fix this issue.

Link to comment
Share on other sites

Positive it is not called.

The batch file I am calling will create a log file and delete a file.

Without a path it does not work.

With a path it does work.

calling from

cmdhide tocall.bat
pause

tocall.bat

del /q todelete.txt
>>c:\test.log echo it works

Create a todelete.txt file and run the top batch file. It won't work.

Add a path to the tocall.bat and it works.

Thanks

Link to comment
Share on other sites

There has been application called run.exe available for a long time from makers of cathy.exe to run applications/ batch files in the background without any window being created.

Edited by pmshah
Link to comment
Share on other sites

No more error message but the batch file is not called.

and another "bug".

I can't use environmental variables like %systemdrive% either.

So the path to the batch must be an absolute path.

Unfortunately this will not work in unattended situations where drive letters are variable like in a RunOnceEx file.

Is it possible to add these features?

thanks again.

EnvVars fixed. Batch not running when no path is given fixed.

Thx!

Link to comment
Share on other sites

There has been application called run.exe available for a long time from makers of cathy.exe to run applications/ batch files in the background without any window being created.

Just for the record:

Actually, "run.exe" has nothing to do with cathy.exe, :no: , it is part of the cygwin utilities:

http://cygutils.fruitbat.org/run/index.html

It's use is advocated in an article related to cathycmd.exe, though ;) :

http://www.virtualplastic.org/html/alt_find.html

Cathy homepage:

http://www.mtg.sk/rva/

jaclaz

Link to comment
Share on other sites

Thanks for the update I will test it tomorrow.

:update:

I tested it.

The env variables work now. Awsome!

I get a different error when calling without a path. seen below.

Siginet how are you calling a batch without a path to make it work?

Did you try it the same as me?

post-94394-1152661810_thumb.jpg

Edited by jaws75
Link to comment
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...