General discussion

Locked

How to make a command window invisible t

By jshara ·
When any program is run from the command prompt, the command window is visible to the users. I want to run a program which only runs from the command prompt. I have placed it in the startup folder os all users under windows NT. The program runs but it is visible to the user. The user can close it at any time. I want the program to run in the background but it should be invisble to the users i.e. it should not appear on the task bar or on the desktop. Any bright ideas to help me out?

This conversation is currently closed to new comments.

27 total posts (Page 1 of 3)   01 | 02 | 03   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

How to make a command window invisible t

by baird_k In reply to How to make a command win ...

Run the cmd with a switch /c. That will terminate the dos prompt. For example:

cmd /c dir

KB

Collapse -

How to make a command window invisible t

by jshara In reply to How to make a command win ...

The question was auto-closed by TechRepublic

Collapse -

How to make a command window invisible t

by felixenescu In reply to How to make a command win ...

The solution is to use a wrapper utility to
launch your program.
I can send you binaries of two programs
but maybe you prefer a source code.

If you have acces to a C compiler use the
following code:

-------- CUT -------

#include <windows.h>
#include <string.h>


int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;

char prog[] = "my_prog.exe";

WinExec(prog, SW_HIDE);

return (msg.wParam);
}

-------- CUT -------

The unhide program is a little longer.
I'll send it to you if you want.

Also search :
http://www.nettally.com/waldoe/freeware/winutil.html
for window.zip

Collapse -

How to make a command window invisible t

by jshara In reply to How to make a command win ...

The question was auto-closed by TechRepublic

Collapse -

How to make a command window invisible t

by baird_k In reply to How to make a command win ...

By the way...I assumed that you were running on Windows NT. To make the script a little cleaner run:

%comspec% /c "program"

That will allow the .bat or .cmd file to run on '98, '95 or NT.

KB

Collapse -

How to make a command window invisible t

by jshara In reply to How to make a command win ...

The question was auto-closed by TechRepublic

Collapse -

How to make a command window invisible t

by Green Lantern In reply to How to make a command win ...

In a straight scripting environment, you can't hide the CMD window from your users. You can launch it minimized by using the "start /m" command. This will put it in the systray at the bottom of the screen.

All other methods of hiding the CMD prompt require writing a program to accomplish what you want to do.

Collapse -

How to make a command window invisible t

by jshara In reply to How to make a command win ...

The question was auto-closed by TechRepublic

Collapse -

How to make a command window invisible t

by MRshawng In reply to How to make a command win ...

Have the Schedule Service launch the program, and set it not to be Interactive. However, you must configure the Schedule service on each system properly. You'll also have to get an exe called soon.exe, from the resource kit. SOON is similar to the AT command, except that you don't have to specify a time, it automatically executes the command line in five seconds. Example "soon C:\myscript.bat" would launch myscript.bat in 5 seconds, and would not be interactive, therefore not visible to any users.

Hope this is what you wanted.

Collapse -

How to make a command window invisible t

by jshara In reply to How to make a command win ...

The question was auto-closed by TechRepublic

Back to Windows Forum
27 total posts (Page 1 of 3)   01 | 02 | 03   Next

Operating Systems Forums