cmd

Batch File - Into a Variable

Hi guys Havin' problems tryin' to get the string after the : in the following two lines into two seperate variables from the bottom of a text file called file.txt for example Number of files to delete: 27 Total Total size of files to delete: 1,427 KB I just want the 27 in one variable, and the 1,427 in another. These are randomly gen...

An easy bulletproof technique to check if the system has jre (windows)

Hi. Sorry my newbie question :P If I promp "java -version" in the cmd on a windows system, am I guaranteed that the system will be able to run .jar files if I don't get any error? ...

PowerShell Script in PostBuild

Continuous Integration I have been working on a PowerShell script to keep our development process streamlined. I was planning on running it as a post-build event, but I'm having some trouble. From the PowerShell prompt, the following works wonderfully: PS C:\> ./example.ps1 However, when attempting to run this from cmd.exe as follo...

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&s=books&qid=1241362727&sr=8-1 http://www.ss64.com/nt/for...

Send ctrl+c to a cmd.exe process in c#

I'm currently writing myself a little C# back up program. I'm using a standard windows form for the interface, and am calling cmd.exe as a new process, and then using XCOPY from within this new process. Every thing's working great, except for this last feature I want to add in, which is the ability to break the operation. From a nat...

New window question for batch (.bat) files.

I'm using a batch file to open a few new windows. Once they complete their processes, I have the /c set they quit. However, I'd like for my main batch process to wait for one window to finish before moving on, instead of doing everything at once. For example, if my main batch file has: @ECHO OFF start "Win1" cmd.exe /c scomp -out ........

In a batch file, how do I delete all files NOT of a certain type...

I'm writing a batch file that needs to delete all the files in a certain dir and all of it's subdirectories except those of a specific type. How can I do this? ...

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...

In detail: mklink and its options.

I recently followed a small tutorial on howto install apache on a systems where you're not the admin. Basically, the original htdocs and conf folders were copied to a map I have ownership over, the original ones deleted and then symbolic links were created. Now, I checked mklink /? and it gives several options. Directory symbolic link...

Windows cmd encoding change causes Python crash.

First I chage Windows CMD encoding to utf-8 and run Python interpreter: chcp 65001 python Then I try to print a unicode sting inside it and when i do this Python crashes in a peculiar way (I just get a cmd prompt in the same window). >>> import sys >>> print u'ëèæîð'.encode(sys.stdin.encoding) Any ideas why it happ...

.bat files, nonblocking run/launch

How do i launch 2 apps at once in a .bat file? my current text is cd mydir my.exe my.exe difParams //bat is finished. i dont want my.exe to close ...

How can a batch file locate where it is located?

How can a batch file by itself see where it is located? ...

mkdir -p Linux..Windows..?

hi all, thanks to all for ur valuable replies.. Also, in linux mkdir -p creates a folder tree.. What is the equivalent option in Windows( to create a folder tree) ? Is there any? Renjith G ...

C#: How would I execute this command line directly to java.exe ?

I am writing a program that needs to run a java.jar server. I need to run the process directly so I can rewrite the output to a textbox and all-in-all have complete control of it. I tried just doing it through CMD.exe, but that wouldnt work because CMD.exe would just call a new process java.exe and I wouldn't have control of it. I need t...

Redirect batch stderr to file

I have a batch file that executes a java application. I'm trying to modify it so that whenever an exception occurs, it'll write the STDERR out to a file. It looks something like this: start java something.jar method %1 %2 2>> log.txt Is there a way I can write the arguments %1 and %2 to the log.txt file as well? I don't want to wri...

Windows equivilent to UNIX pwd

How do I find the local path on windows in a command prompt? ...

Compiling J2ME from command prompt

hi, i'm trying to compile the J2ME java files from command line from 2 week ago ! at now i can compile project successfully and also create JAR and JAD files . the files that i compile work equivocal, this means if i use basic class the same as TextField or Form or others this work successfully but if I use RecordStores OR more important...

How to load ANSI escape codes or get coloured file listing in WinXP cmd shell ?

This is related to this question : How to get coloured file listing in windows cmd shell ? I'm trying to get, wouldn't you believe it, coloured file listing in windows cmd shell. Windows are XP SP2, if that matters. In the old DOS days there used to be little programs like hdir, adir and such which displayed that nice. Nowadays, such pr...

Grant SeServiceLogonRight from script

I need to be able to grant rights to a user from a script (a batch file or JScript file). In particular, I want to grant SeServiceLogonRight to a particular domain account. I can't use NTRights.exe (not available on all target OS's), and I'd like to avoid having to write an executable in C just for this. Is it possible to do this with st...

Is there a parameter for MSDOS commands (e.g. ipconfig) that cause them to wait for input before disappearing?

When I run e.g. ipconfig using the Run command (windows key+R), once the program has executed it immediately closes the instance of the command line interface, is there any universal parameter I can add to: ipconfig nslookup dir etc... to ensure that the results stay printed in the console window? ...