I am writing a service program which is expected to run in background. On Windows it will open a console window when run. I want it to go to background directly without that console window, so I used the -ldconf "-H=windowsgui" option, which worked as expected.
However, there is a catch. The program has a command line option -help, which output command line usage in the console. If I use -H=windowsgui, the help text is NOT printed even I start it in cmd.exe prompt.
It seems that the windowsgui option is not what I want. Is there anyway that the -help still works at commant line, and the console window will not persist if the program runs normally. I do not care if there is a console window pops up, provided that it disappears shortly without user intervention. i.e. I want a way on windows which is similar to the & operator on Linux.
P.S. if provided solution uses any other tools, I want that tool to be a Windows component, not any 3rd-party program. Thanks.
I basically would like to execute a (Cygwin-) Ruby program by clicking on some icon on my desktop. My first attempt went like this:
Create a desktop link
As a link target, have something like
c:\cygwin64\bin\ruby /path/to/my/ruby/program
This works, but it also opens a window where Ruby "runs in", which is not what I want to have.
If it were ActiveState Perl, I would have a command "wperl", which executes Perl without creating a Window, but such an feature doesn't seem to exist for Ruby, at least not for the Cygwin distribution.
I tried to change the link to
cmd /MIN /C c:\cygwin64\bin\ruby /path/to/my/ruby/program
hoping, that this would run the window minimized, but same effect as before, so I think I need to program somehow a wrapper script which suppresses the creation of this window. Does anybody know how this can be done, preferably using the Windows Batch language or some clever commands in the Cygwin tool chain?
I need to write a huge VBscript to automatically run an application and I'm looking for a way to comfortably monitor what I'm actually doing, in other words, to display the values of some/all variables involved in my script.
I'm used to work with Matlab, where I have a comfortable workspace browser. When I run a Matlab script, all variables, their types and their values are accessible in that workspace and can be checked.
The VBscript I write with Notepad++ (it needs to be a free editor) and the only way I found to display variables was echoing them via wscript and cscript.
I set up the shortcuts.xml with the following line to run my script directly from Notepad++:
<Command name="Run with CScript" Ctrl="yes" Alt="no" Shift="yes" Key="116">cmd /K %windir%\system32\cscript.exe "$(FULL_CURRENT_PATH)"</Command>
In case I include commands in my script like
Wscript.Echo myVar
Wscript.Echo "Hello World!"
and run it with the newly introduced shortcut, a cmd window pops up and displays the value of myVar and "Hello World!".
But the next time I run the script a new window pops up. So my question is:
Is it possible get a continuously opened output window, displaying all echoed values everytime I run a script? I actually want to put the window on a second screen and keep the values from previous runs. So I can enter a line Wscript.Echo something, run, check, enter something else and so on, without fiddling around with a bunch of opened windows.
Alternatively, is there any open-source/free editor which offers an accessible workspace like the one in Matlab?
The open-source editor SciTE offers what I was looking for.
The default settings in vb.properties enable a similar behavior like in Notepad++
command.build.$(file.patterns.wscript)=cscript "$(FilePath)"
command.build.subsystem.$(file.patterns.wscript)=1
One can change it as follows to get the output into the integrated console.
command.go.$(file.patterns.wscript)=cscript.exe //nologo "$(FilePath)"
command.go.subsystem.$(file.patterns.wscript)=0
F5 runs the script and Shift+F5 cleans the output.
Another option is the NppExec Plugin for Notepad++ suggested by #Ansgar Wiechers, which adds a console. The script can be run with cscript.exe /nologo "$(FULL_CURRENT_PATH)" then.
Use a debugger. Start your script with the (meta)option //X. If you are lucky, you already have installed software (MS Office, Visual Studio (Express)) that provides a debugger for VBScript. If not do a bit of research to find an Express version suitable to your OS.
You can almost write native VBScript in the VBA editor, so if you have Excel or whatever you can use this to debug, then go through some steps to convert back to VBScript. That's what I usually do.
I'm new to programming and have taken some classes in it so I'm not sure if this is possible. I want to use a COTS software called 010 Hex Editor and write a script for the program to automate a couple tasks. These tasks can be run from a batch file according to their documentation.
Then I want to instruct the user to eject the device and reinsert it to clear the cache. (This I want done just with a simple pop-up window.
Then I also want to format the device which I assume can be done in a batch file as it can be done through dos on Windows.
My question is, with these 3 steps, can I build a simple GUI that has a button that says, "Start" or something like that, then the pop up window comes up to eject and reinsert, and then another button to format, and another button to exit. I'm not really familiar with what language this could be done in, and how to do this as the C++/Java classes I've taken have been more about syntax and OOP. Thanks!
You can use the windows messenger service to put up an alert - but on newer windows (vista/7) it's a pain to set all the permissions to allow this.
There are lots of free utilities that will popup a dialog from the command line, with a given message and wait for a response.
They are generally called messagebox or msgbox - sorry can't recommend any in particular
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Is there a better windows command line shell other than cmd which has better copy paste between Windows' windows and console windows?
Enable QuickEdit mode, under the Options tab of your shortcut to the command shell. Mark with the mouse, right-click to copy, right-click again to paste.
While you're there, enable a hotkey (like CTRL + ALT + C) for lightning fast access to the shell.
And no, you can't have CTRL + C for COPY, because CTRL + C means BREAK.
On a related note, the Microsoftee who changed the default setting of QuickEdit mode between Windows Server 2000 and 2003 is an idiot and I heap curses upon him each workday.
Windows PowerShell is the obvious choice when it comes to "better windows command line shell other than cmd". Its clipboard handling isn't that much of an improvement - mark with the mouse, Enter to copy, or right mouse click to paste.
This probably is not exactly what you want, but you can take a look at Console2
I have it configured so that shift+select auto copies and middle click pastes, really handy, internally it uses same old cmd.exe so you are not really getting a different shell.
By the way, I guess Ctrl+C = copy is not the best idea in a command line context because it usually means interrupt running process.
Take Command does support Copy/Cut/Paste from the keyboard and the mouse. It's pretty handy if you do a lot of work from a command prompt. It also supports:
Command and folder history, with popup windows to select prior commands or folders.
Screen scroll back buffer
Enhanced batch commands
Built in FTP/HTTP file access
A toolbar with programmable buttons
Note: It's a paid tool, with price of $99.95.
Depending on what you're trying to do with the shell, rxvt in cygwin is good.
You'll get the nicety of auto copy on selection and middle click paste. The biggest downside is that some windows console apps don't play nice with cygwin.
PowerCmd is cheaper than TakeCommand and has a lot of powerful features - not the least of which is better handling of Cut/Copy/Paste. I've only been using it a short time but I'm really impressed so far:
Summary from the site:
PowerCmd enhances your command prompt
with an easy-to-use Windows GUI-style
interface and allows you to run
multiple consoles within a single
tabbed window. You can easily organize
multiple consoles in vertical,
horizontal, and grid forms. Auto-log,
auto-completion, keywords highlight,
configurable font and colors,
customizable toolbar for frequently
used commands or tools and minimizing
to tray are easy solutions to daily
needs. With PowerCmd, you can save and
restore your sessions from last time.
Site:
http://www.powercmd.com/
Features:
http://www.powercmd.com/features.php
Not sure what specifically you mean by better copy/paste but try Take Command.
Take Command supports Shift+Ins for paste and Shift+Del for cut, but apparently nothing for copy, will dig some more.
There are two portion to cmd.exe. First there is the window that pops up for dealing with the text console. I would replace that with ConEmu. That program is actually meant as a wrapper for the Far File manager but works just fine without it. It is very similar to Console2 but also is much more stable and has better features.
Second there is the command line interpreter. I would replace that with Powershell if you actually need any of its features.
I currently run using ConEmu with a batch file to setup my preferred environment. This is kept in my Dropbox folder so it remains synchronized between my computers.
Have you thought through what behavior you want to replace the current Ctrl+C functionality?
Console 2
http://sourceforge.net/projects/console/
http://www.hanselman.com/blog/Console2ABetterWindowsCommandPrompt.aspx
#Chirs
I think you need to clarify shell vs host(emulator). To me it sounds like you need another interface to your existing shell that better supports copy and paste, not another shell that supports more/different features.
I second Pat's suggestion of Console2, it is a very good application and OSS to boot.
The Windows cmd shell, Cygwin Bash, and msysgit Bash shells can be run within Emacs. EmacsW32 provides all three separately. You just have to set the bin directory to use either of the Bash shells. EmacsW32 also provides limited interactions between the Windows clipboard and the top item of the kill ring.
MinGW Shell properly set up with:
right click menu entry
~/.profile file
is well above anything else I have tried.
MinTTY on MinGW/MSYS is nice—nicer than on Cygwin because MinGW/MSYS is faster. Also, if you need cmd.exe behaviour, you can run cmd.exe inside of mintty easily.
See http://code.google.com/p/mintty/.
I use the standard CMD.EXE shell but with a twist: an AutoHotKey script to support clipboard copy-paste as posted in: Keyboard shortcut to paste clipboard content into command prompt window (Win XP)