cmd.exe

Number of files deleted from batch file

REM Detect how many files are on the C: drive dir /s /b C:\ |find /c "\" > NUMfiles.### set /p count1=<NUMfiles.### ##### TEMP FILES DELETED HERE, RUN CCLEANER, RUN MBAM, ETC ##### REM Calculate Total Files Deleted dir /s /b C:\ |find /c "\" > NUMfiles.### set /p count2=<NUMfiles.### set /a count3=%count1% - %count2% echo Number of fil...

Is there a better Windows command-line shell?

CMD.EXE is posing lots of problems for me. I have Cygwin installed and use bash regularly, and I also have the mingwin bash shell that comes with mSysGit, but sometimes I really do need to run things from the Windows shell. Is there a replacement for the Windows shell that: has a persistent command-line history, available in my next ...

How to bring a CMD.EXE window to top

How to bring CMD.EXE window to top? (I would prefer a command or script without a need to compile anything). ...

How does "FOR" work in cmd batch file ?

I've been programming in dozens of languages for 20 years but I could never understand how "FOR" work in windows cmd shell batch file, no matter how hard I tried. I read http://www.amazon.com/Windows-Administration-Command-Line-Vista/dp/0470046163/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1241362727&amp;sr=8-1 http://www.ss64.com/nt/for...

Windows equivalent of ls * (asterisk) directory wildcarding?

Another question from an long-time Unix/Linux user who finds himself in a Windows world. First let me explain exactly what I'm trying to do. I'm using the Windows cmd.exe shell, and I want to list all directories below the current directory that contain a bin\Debug hierarchy, and determine if they contain any files (e.g.: trying to fig...

How can I switch from CMD.exe to Powershell?

I have this idea that I should switch over from cmd.exe to powershell. It's so much more powerful than the tried and tested cmd.exe. It is the shell of the future for Windows. But my facility in powershell is so limited, in comparison with cmd.exe. Around every corner I discover another seemingly small obstacle that is insurmountable...

Restore MYSQL from CMD line using Java Environment.

Hi GUys, I am using Java and Mysql for a Program, I am Using a Script File in order to restore a Databsae. Under Java I am Executing a command:under bin: mysql -u root -proot test< c:\test.mysql It is not running while If I run it under cmd line it will execute properly and restore the database. Is anybody there who knows.. why it hap...

Copy file(s) containing string to a location oneliner - is there a better way with cmd.exe ?

This for /f "tokens=*" %i in ('dir *sonic.exe /s /b') do copy /y "%i" D:\temp\utils\ The question is there a better or shorter way to do it ? p.s. I know that "tokens=*" could be omitted if the file path does not have spaces .. Update: I found a shorter ways of finding ( not copying ) from my old cheat sheets: ::START - RUN - cmd...

Modify cmd.exe properties using the command prompt

Isn't that nicely recursive? I've got a portable command prompt on my external drive, and it has a nice .bat file to configure some initial settings, but I'd like more! Here's what I know how to set from .bat: Colors = (color XY) where x and y are hex digits for the predefined colors Prompt = (prompt $p$g) sets the prompt to "C:\...

StackOverflow reputation using Windows Command Prompt (cmd.exe)

How can I view my reputation with a Command Prompt script? (In reply to StackOverflow reputation using PowerShell, because I'm bored as hell.) ...

End of Line on Windows cmd

I have a while(cin >> string) loop in which I want the user to input a string. However, I do not know how to end the input. I know on *nix machines for bash shell, I can use ctrl-D. But this does not seem to work on cmd.exe for Windows... Any tips? [Edit] This is on C++ ...

Holding cmd.exe open on Vista

I'm writing C++ console programs. After compilation, when I run the program from my file browser, cmd.exe automatically closes such that I can't see my programs output. The only way to work around this I've found is to run the program from inside cmd.exe Is there anyway to keep cmd.exe open after a program finishes running? Is there a...

Win7 command processor (CMD.EXE) really slow

Does it seem to anyone else that the Windows 7 command processor (CMD.EXE) is really slow starting up? I ran this test from a command line (ntimer is a timing utility from the Windows server resource kit and you can just leave it out if you don't have it installed): ntimer cmd /c for /l %a in (1,1,100) do @cmd /c rem All it's doing...

How can i take snapshot of command prompt window in full screen mode.

Hi all, I need to take snapshot if command prompt window running in full screen mode. I had tried it using PrintScreen,Ctrl+PrintScreen, Ctrl+Alt+PrintScreen button(s) but nothing seems to work Also are there any reasons that the print screen button does not work in full screen commandprompt mode? After all, it does for all windows u...

C# write a simple string from winforms --> cmd prompt telnet

Hello, I need to pass a simple string to a command window (running telnet), from a c# winforms app... is there a simple way to do this? I tried the following, but it's all or nothing when redirecting standardinput-- the winforms app doesnt have to start the cmd window... the cmd window could already be running also-- I thought maybe t...

How to run multiple bat files within a bat file

Im trying to get my commit-build.bat to exceute other bat files as part of our build process. content of commit-build.bat: "msbuild.bat" "unit-tests.bat" "deploy.bat" Seems simple enough? But the commit-build.bat only executes the first item in the list (msbuild.bat). I have run each of the files seperately with no problems. ...

CMD: How many left

I just want to figure out,, How can a batch file (CMD) tell me how many days i'm left from any date...??? Such as: set setdate=24/07/2009 echo The date is now: %date% echo Your set date is: %setdate% echo You're %days% days left from %setdate% Thanks! ...

How to pass a quoted pipe character to cmd.exe?

I want to invoke: "c:\(...)\devenv.com" foo.sln /build "Debug|Win32" using cmd.exe. In my experience, cmd.exe either strips out the first pair of quotes (causing the executable to not be found) or the second pair of quotes (causing the pipe character to be misinterpreted). How do you pass a quoted pipe character to cmd.exe? ...

How can I suppress the "terminate batch job" in cmd.exe

I'm looking for a mechanism for suppressing the "Terminate batch job? (Y/N)" invitation that I get whenever I press CTRL-C in a program started from a batch file: batch file: jsshell.bat: @echo off java -jar build-scripts\contrib\rhino1.7R1.jar and then starting it on cmd shell by: > jsshell.bat which gives me a shell that can be...

Windows prompt: ISO 8601 date?

How do I set the command line prompt in Windows to display current ISO 8601 date and time (e.g. 2009-09-08T13:01:56) instead of the default of current directory? Update. Set it by: right click My Computer/Properties/tab Advanced/Environment Variables/System Variables/New/ Variable name=PROMPT and Variable value=$DT$T $P$G /OK/OK/OK. Reg...