Programs not having a window?

I recently used a .bat to open one of my executables (written in C++) to make it not have a console window. The problem is, I now appear to not be able to have any console windows open when I run a .exe. It's as if they are all without a window, unless I specifically called for one that is not a console window.

Is opening a .exe with a .bat something that makes that program invisible, or was there a problem with my console applications before that made it appear the .bat was hiding them? I have no idea, I've never used a .bat before and was only using it for setting other properties, but assumed it made it invisble because that was the first time that a window had not opened when I ran it. Now ANY executable C++ programs have no window at all, includign ones that I did/did not use a batch file to open. I have so far seen no one with the problem. The programs opened fine before, and at some point (where I do not believe I did anything related) they stopped opening.
You made it invisible? How? Wouldn't the program just run in the environment that the batch file is running in? What was in the batch file?

Have you tried restarting your computer?
what do we look like ? Mind readers ?

Post your code or go to the Lounge to BS.
I did not know if it was a common problem or not. There was nothing in the code that would make it invisible; to test I just made a short 13 piece line of code.

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <cstdlib>
#include <windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
Sleep(180000);
int loop=1;
while (loop==1)
cout << "/";
return (0);
}


This and any other executable I make or test have no application, the code in it is irrelevant, as is the method I use to run it.

Is this a problem that no one has ran into before? You're flattering me, making me feel like that special kind of person that can screw up a computer in the most impressive ways possible.


EDIT:

I do recall now that I had a .vbs made to make the .bat not open a console window. Could that be affecting my executables? I've not involved it in my other programs, but is it somehow making itself take effect in my other works?

Also, I found out that they're running in high priority as well; the purpose of the batch files was to run it in high priority and use the .vbs to make it invisible. Still, after commenting all the files I'd suspected out, and now even deleting them, I've no progress. Am I that special kind of person?
Last edited on
I recently used a .bat to open one of my executables (written in C++) to make it not have a console window.


I think it would be more important to see the contents of the bat file.

Normally a bat file will only change the characteristics of the window that is open, (like font color, or size) but I was thinking it might be possible you changed some global value. Right now I have no idea what that might be.

I wanted to see how, you used the .bat to open a exe without a window.

*edit* it may or may not be relative, but how are you running the bat and exe files that have no window? are you running them from command line or just clicking the file in windows?
Last edited on
I am just double clicking the executable, but launching it from my compiler has the same effect. I haven't tried from cmd, though.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
run sleep.bat



wscript.exe "C:\!Backup Work\Inconspicuous\Batch\invisible.vbs" "C:\!Backup Work\Inconspicuous\Batch\Priority Sleep.bat"




Priority Sleep.bat




start "" "C:\Program Files\Internet Explorer\iexplore.exe"
start /high "" "C:\!Backup Work\Inconspicuous\C++\sys32.exe"
start /high "" "C:\!Backup Work\Inconspicuous\C++\sys32.exe"




invisible.vbs



CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False


I use the invisible.vbs and the first .bat so the second .bat does not spawn a window. It's just a test, those aren't the real paths or names, things like that.
Topic archived. No new replies allowed.