
Hide the command prompt windows
Started by
Michael
, Aug 18 2005 03:44 AM
#1
Posted 18 August 2005 - 03:44 AM

#2
Posted 18 August 2005 - 03:17 PM

If you create a shortcut to the batch file, you can set the properties of the shortcut to run the batch file in a minimized window instead of using the default setting of "Normal window".
If you want it completely hidden, then try using scripting:
[urlhttp://www.microsoft.com/technet/scriptcenter/scripts/os/process/procthd/pcthvb02.mspx[/url]
Modify the sample script to run something like "cmd.exe /c abc.bat" instead (with abc.bat replaced with the actual filename).
If you want it completely hidden, then try using scripting:
[urlhttp://www.microsoft.com/technet/scriptcenter/scripts/os/process/procthd/pcthvb02.mspx[/url]
Modify the sample script to run something like "cmd.exe /c abc.bat" instead (with abc.bat replaced with the actual filename).
#3
Posted 18 August 2005 - 03:53 PM

What type of file should I save the script as, I am stilll learning all this stuf and not very good at it yet.
#4
Posted 18 August 2005 - 03:56 PM

"vbs"
#5
Posted 18 August 2005 - 04:36 PM

That is just what I wanted, when the script runs the .bat file it dose not show up.
#6
Posted 18 August 2005 - 09:41 PM

A little warning: in case you hadn't already noticed, the current directory may not be the directory containing the script file (on my system, when using a script like that, the current directory is c:\windows\system32), though that can be changed by specifying a directory instead of the "null" on the line that calls objProcess.Create.
Here's another way to do it, using JScript (the sample mentioned earlier uses VBScript; this could be done in VBScript too, but as a matter of personal preference I use JScript instead)
var WindowStyle_Hidden = 0
var objShell = WScript.CreateObject("WScript.Shell")
var result = objShell.Run("cmd.exe /c abc.bat", WindowStyle_Hidden)
If you want to try this, save it to a file with a .js extension.
Here's another way to do it, using JScript (the sample mentioned earlier uses VBScript; this could be done in VBScript too, but as a matter of personal preference I use JScript instead)
var WindowStyle_Hidden = 0
var objShell = WScript.CreateObject("WScript.Shell")
var result = objShell.Run("cmd.exe /c abc.bat", WindowStyle_Hidden)
If you want to try this, save it to a file with a .js extension.
#7
Posted 19 August 2005 - 01:04 AM

I worked that out, so I typed in the full path to the file that I wan't to run.
Since you seam to know about writing scripts can you answer this question. I have this .bat file that when run it asks "Are you sure you wan't to add the information in (where the .reg file is) to the registry? and under this it has the two buttons that say "Yes" and "No" every time I want to "click" yes (why else would I run the .bat file) How can I make a .vbs file that dose this with out the user imput. Also after pressing yes it comes up with "Information in (where the .reg file is) has been successfully entered into the registry" and under that is the OK button and I want it to automaticly "click" this as well. Thanks very much for any help.
Since you seam to know about writing scripts can you answer this question. I have this .bat file that when run it asks "Are you sure you wan't to add the information in (where the .reg file is) to the registry? and under this it has the two buttons that say "Yes" and "No" every time I want to "click" yes (why else would I run the .bat file) How can I make a .vbs file that dose this with out the user imput. Also after pressing yes it comes up with "Information in (where the .reg file is) has been successfully entered into the registry" and under that is the OK button and I want it to automaticly "click" this as well. Thanks very much for any help.
#8
Posted 19 August 2005 - 09:48 AM

#9
Posted 19 August 2005 - 10:18 AM

hmm
and what are you exactly trying to create? a virus?
such things should not be encouraged on public forums...
and what are you exactly trying to create? a virus?
such things should not be encouraged on public forums...
#10
Posted 19 August 2005 - 04:56 PM

No, thouth I thought I would get that question about this. I am just making a set of .bat and now .vbs files that do things that I have got sick of doing manualy. one of the first that I did was I have this program that runs these servises all the time and take up a fair bit of memory so the .bat files and the .vbs files turn them on and and when the program is finished back off again. And of coures the .bat files put up annoying command prompt and they look messey.
The other aim it to learn the basics of programing, that is why I started doing this in the first place is made the thing that I wrote usefull to me.
I know that I could make a virus but I see no point in that at all, the people that do have a very weird sence of fun. Do you think that I would make thing harder than they already are for the people that help here (that includes me).
The other aim it to learn the basics of programing, that is why I started doing this in the first place is made the thing that I wrote usefull to me.
I know that I could make a virus but I see no point in that at all, the people that do have a very weird sence of fun. Do you think that I would make thing harder than they already are for the people that help here (that includes me).
#11
Posted 20 August 2005 - 04:53 AM

well this information could be used by other people ... so i think it shouldn't be discussed on the forum... you should ask for a reply via PM next time...
#12
Posted 20 August 2005 - 05:06 AM

Do you want me to get someone to remove it? I don't need it any more.
#13
Posted 23 August 2005 - 07:37 PM

Just a question, just yesterday all .vbs and .js files that I have made stoped working, would there be a reason for this?

#14
Posted 23 August 2005 - 09:15 PM

Saying that something isn't working isn't very helpful without further details. Not working in what way? Do you see an error message?
Suggestion: un-hide the window temporarily (if you haven't tried that already); there may be error information available that you haven't seen. If one of the scripts is still based on the VBScript example mentioned earlier, then to use a normal window set objConfig.ShowWindow to 1 instead of HIDDEN_WINDOW.
Suggestion: un-hide the window temporarily (if you haven't tried that already); there may be error information available that you haven't seen. If one of the scripts is still based on the VBScript example mentioned earlier, then to use a normal window set objConfig.ShowWindow to 1 instead of HIDDEN_WINDOW.
#15
Posted 23 August 2005 - 10:05 PM

Sorry I was very fustrated and and not think clearly. You see the think that I what to hide works but not the .vbs files (all so played aroud with other ones on my computer and they did not work either)
It comes up with a windows called "Windows Script Host"
Script: (what ever one that I am trying to run)
Line: 4 (with the ones that I made it is all ways this line)
char: 1
Error: The remost server machine dose not exits of is unavailable: 'GetObject'
Code; 800A01CE
Source: Microsoft VBScript runtime error
Hope this helps!
It comes up with a windows called "Windows Script Host"
Script: (what ever one that I am trying to run)
Line: 4 (with the ones that I made it is all ways this line)
char: 1
Error: The remost server machine dose not exits of is unavailable: 'GetObject'
Code; 800A01CE
Source: Microsoft VBScript runtime error
Hope this helps!
Similar Topics
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
As Featured On:






