how to modify exe to make it console window hidden? - console

I have a program. The program had open a console window to display logs when it is started. I dont like this window, but no source code. So, how to hide this console? such as modify exe file?

You can start it hidden.
I use this little VBScript code to do it. Create a start hidden.vbs file in the same folder of your program.exe and write this code in it:
Set oShell = CreateObject("WScript.Shell")
oShell.Run "program.exe", 0
Run the start hidden.vbs and it should start the program hidden. The process will be only visible in the Task Manager.

Related

Creating an executable R-file

I want to make an executable R-file (for automation purposes). Therefore I concluded the following tutorial.
After completion however nothing happens... Only the .Rexec file opening in RStudio (in stead of running it and showing me the pop up...
Any more people experienced this? Any clues to where to look to fix this?
The tutorial you gave is useful. However, it missed something.
After done all the things in that blog, you still need to do one more thing. Right click on the "test.Rexec" file and choose "open with" and then select "RScript". Maybe you need to find RScript in your system which is usually here:
C:\Program Files\R\R-3.2.1\bin\Rscript.exe
Remeber to check the "Always use the selected program to open this kind of file".
Next time, when you double click the "test.Rexec" file, evethying would be okay.
I found no need to create Rexec file.
I created .bat file and then set it up in Task Scheduler.
The .bat file opens up the Rscript.exe, as shown in prev answer above. The .bat file then points to the .R file, that I want to be executed.
For some time, I could not get it to work, but solution was to point to Rscript.exe as mentioned above. Then it will not open up in compiler.
Works fine for me.

Pydev - startup

Maybe I got simple questions so I googled it but I can't find answer.
I am using Pydev/Eclipse and I want to run the script within Console.
First I want to modify the startup of the session - it means some modules are loaded during start (math, numpy, scipy, etc...).
Where/how can I modify Pydev Console startup?
Secondly, I execute the script using righ-click on script file and "Run as -> Python Run" then it's executed within console and terminated. So I want to stay within Console and to be interactive and not be terminated.
How can I get such feature?
Thank you!
Best regards,
Peter
The startup configuration can be found in the PyDev preferences menu. The preferences can be found in the upper menubar under 'Window'.
Window -> Preferences -> PyDev -> Interactive Console
There you will find a big text input field with a label 'Initial interpreter commands'. Often it is allready in use and imports sys only to print the name and version number of the starting console.
The only solution I am aware of for staying connected with your script is to set a breakpoint at the end and start your script in debug mode. But maybe there is another way. To do so just double click at the left corner of the editor window with your script opened. A green dot will appear marking a breakpoint. Now right click an choose 'Debug As'. Your script will run till the line is reached where you have set the breakpoint.
Hope I could help.
I think that what you want is the interactive console. See: http://pydev.org/manual_adv_interactive_console.html
You can configure the initial commands in the preferences page.

Determine programmatically if an AIR app was launched from the command line?

Is it possible to determine programmatically whether an AIR app was launched from the command line or via double-click on the application icon?
I want to be able to do something like:
`if (e.launchedFromCLI) { foo(); }`
Try listening to NativeApplication INVOKE event, it is the only place I know where you can find such info.
Seems that you can not distinguish CMD launch from icon launch - unless you pass some arguments in CMD.
http://help.adobe.com/en_US/AIR/1.5/jslr/flash/desktop/NativeApplication.html#event:invoke

Consoles and Tabs

When I start the tomcat server from console using the startup.bat script, a new command window opens which is filled with java logging statements.
I use Console2 which leverages tabs for each open console window. Is it possible to let the java system create a new tab within console2 instead of just opening a new command window?
This has nothing to do with java, its merely down to the way the catalina.bat is called from startup.bat
catalina.bat can be called with either a "start" argument or a "run" argument.
run Start Catalina in the current window
start Start Catalina in a separate window
So open startup.bat, scroll to the bottom you should see
"%EXECUTABLE%" start %CMD_LINE_ARGS%
change that to
"%EXECUTABLE%" run %CMD_LINE_ARGS%
exit
I add an exit after to close the calling window.
Unless Console2 hooks any APIs that create console windows – no. And that's also highly unlikely that they do or even can. Console2 does nothing more than hook up input and output of console windows. What the programs in those do is beyond what it's interested in.

How to launch qt application with the command window in minimized state, without any flicker?

I am working on VS2005 sp2, with qt3.3.7. I have set the linkers>system>subsystem to Console (/SUBSYSTEM:CONSOLE) as I need the command window to check runtime status of my project at runtime.
I want to launch my application with the command window minimized. The problem is, whenever my application launches, the command window comes in maximize state.
If I minimize this window using :
HWND hWnd = GetConsoleWindow();
ShowWindow( hWnd, SW_MINIMIZE );
still I get a flicker, ie for a split second the command window opens and then minimizes.
How can I launch my qt application with the command window in minimized state, without any flicker?
The only thing I can think of is launching your own console process using CreateProcess() with startupInfo.wShowWindow=SW_SHOWMINIMIZED, and startupInfo.dwFlags |= STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; setting startupInfo.hStdOutput to a handle you can use for output. I've tried launching cmd.exe like this, and while I can get it to start minimized, I haven't managed to write to it. I don't have any more time to play with it tonight, if you manage it I'd like to see the solution!

Resources