prevent users from breaking cmd file

J

JIM.H.

Hello,
I am using START in a cmd file to launch another cmd file
and return back without waiting while launched file was
doing its task. My problem is that STRAT launches cmd
file with a new window and users is able to stop that
batch process by closing the windows even if it is
minimized, how can I prevent users from breaking it? Is
there any way to launch a cmd file at the background
without any window?
Thanks,
Jim.
 
M

Marty List

JIM.H. said:
Hello,
I am using START in a cmd file to launch another cmd file
and return back without waiting while launched file was
doing its task. My problem is that STRAT launches cmd
file with a new window and users is able to stop that
batch process by closing the windows even if it is
minimized, how can I prevent users from breaking it? Is
there any way to launch a cmd file at the background
without any window?
Thanks,
Jim.


Try my freeware utility ShellExecute.exe, it allows you to launch
executables or documents based on their file extension. Similar to the
built-in START command, but in addition to normal, minimized and maximized
you can also launch apps hidden. Use 'ShellExecute /?' to view the syntax.

http://www.optimumx.com/download/
 
A

Al Dunbar [MS-MVP]

Marty List said:
Try my freeware utility ShellExecute.exe, it allows you to launch
executables or documents based on their file extension. Similar to the
built-in START command, but in addition to normal, minimized and maximized
you can also launch apps hidden. Use 'ShellExecute /?' to view the syntax.

http://www.optimumx.com/download/

This can also be done in Windows Script Host along these lines (warning: air
tested code):

const WindowStyleStealth = &H20000000
set WSO = createobject("WScript.Shell")
WSO.run "%comspec% /c secondbatch.cmd", WindowStyleStealth, false

If the above is placed into a vbscript called hiddenBatch.vbs, your primary
batch file could call it like this:

cscript.exe //nologo hiddenBatch.vbs

cscript would run the above script, and the WSO.run statement in the script
would launch "secondbatch.cmd" as a separate process without showing it on
the taskbar and without waiting for it to complete. There are other ways to
detect and terminate the process, but these are less intuitively obvious,
and the same techniques might counteract Marty's program as well.

To make it more general, you would want to recode it to accept the name of
the batch file to be run as a parameter. Since this is primarily a batch
oriented newsgroup, I will avoid going into the details. If you are
interested, raise the question in a vbscript or WSH group.

Marty's solution is likely the best, unless your company has an issue with
third party tools, and/or has in house vbscript expertise.

/Al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top