cmd

windows cmd pipe not unicode even with /U switch

Hello, I have a little c# console program that outputs some text using Console.WriteLine. I then pipe this output into a textfile like: c:myprogram > textfile.txt However, the file is always an ansi text file, even when I start cmd with the /u switch. cmd /? says about the /u switch: /U Causes the output of internal commands...

What would be the Windows batch equivalent for HTML's input type="password"?

I need to get authentication credentials from the users within a Windows script but the classic "first Google result" approach: SET /P USR=Username: SET /P PWD=Password: is less than satisfying, so I was wondering if there's let's say an "equivalent" to HTML's input type="password"? Any comment would be really appreciated, thanks mu...

Free space in a CMD shell

Is there a way to get the amount of free diskspace of a disk or a folder in a CMD without having to install some thirdparty applications? I have a CMD that copies a big file to a given directory and could of course use the errorlevel return from the copy command, but then I have to wait for the time it takes to copy the file (eg...to th...

How do I create a batch file timer to execute / call another batch throughout the day

How do I create a batch file timer to execute / call another batch through out the day Maybe on given times to run but not to run on weekends ? Must run on system times can also be .cmd to run on xp server 2003 ...

Adding to %TIME% variable in windows cmd script

I realize that this could probably be done easier in any number of other scripting languages but started to do it quick in cmd and now Im curious. Looking to start a process at an offset to the time that another process started. Lets say 5 minutes to keep it simple. Is there a way to add to the %TIME% variable? For instance: start /...

Why is the Windows cmd.exe limited to 80 characters wide?

I love stretching my terminal on unix. What is the history or reason behind windows lame command line? ...

Command line reserved tokens

When building an application with a CLI, it is useful to avoid using tokens that are commonly used for shell features. For example, | is used for piping output of one application to input of the next. Please supply a complete list of tokens that would need to be escaped to be used? As a minimum/summary, for each token, please identify...

Console application leaves cmd.exe set size.

I have written a console application that sets the size of the console and output buffer. My problem is that after the program ends I cannot resize my cmd.exe window the way I did before. After the program sets the size of the window it retains that size no matter what I do afterwards. ...

Switching from GUI to Command Prompt in Java?

My professor assigned a project where a simulation is ran through a GUI. To edit it, we need to create a "New" menu item. We haven't learned how to get data from a GUI, and our book does not cover it at all. What I'm trying to do, is when the "New" command is hit, focus gets shifted back to the CMD prompt, where System.out. starts work...

Batch how to end an for-loop properly

Hi, for testing purposes i need an recursive directory with some files, that comes to maximum path-length. The Script used for the creation consists only of two for-loops, as followed: for /L %%a in (1 1 255) do @( mkdir %%a && cd %%a && for /L %%b in (1 1 %random%) do @( echo %%b >> %%a.txt ) ) Now I would li...

Problem with for /f command on Windows XP

Hello. I'm using Windows XP Service Pack 3 and have Command Extensions enabled by default in the Windows Registry. Somehow, the following command does not work on this version of Windows but if I run it in Windows Server 2003 or Windows Vista Business, it works just fine. Any clue? The problem is that on Windows XP, it seems like the /...

git can't remember my passphrase

I have just start using git and i can't get it to remember my passphrase I'm using cmd.exe elevated and my git host is github and i have create a ssh key like that guide on github but i still get *\subnus.mvc>git push origin master Enter passphrase for key '/c/Users/Subnus/.ssh/id_rsa': ...

Running a CMD or BAT in silent mode

How can I run a CMD or .bat file in silent mode? I'm looking to prevent the CMD interface from being shown to the user. ...

Open txt file from C# application

The following code is suppose to open CMD from my C# application and open the file text.txt. I tried to set the file path as an environment variable but when notepad opens it looks for %file%.txt instead of text.txt Any idea why? System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.EnableRaisingEvents=false...

Whats the cmd/powershell equivalent of back tick on bash?

Redirecting command output: eg: echo "Foo `./print_5_As.rb`" would echo "Foo AAAAA" Thanks ...

How to send input to the console as if the user is typing?

This is my problem. I have a program that has to run in a TTY, cygwin provides this TTY. When I redirect stdIn the program fails because it does not have a TTY. I cannot modify this program, and need some way of automating it. How can I grab the cmd.exe window and send it data and make it think the user is typing it? I'm using C#, I ...

Command Line ( or equivalent) tools for .Net Development

Spending most of my time in Visual Studio and using all the IDE tools. I wish I could spend more time using either of the following. *the Command Window in VS *cmd *cygwin, minGW... *PowerShell. *scripts? What are your favorite and essential commands to type in, opposed to keyboard shortcuts or clicking around? ...

How to copy a directory structure but only include certain files (using windows batch files)

As the title says, how can I recursively copy a directory structure but only include some files. E.g given the following directory structure: folder1 folder2 folder3 data.zip info.txt abc.xyz folder4 folder5 data.zip somefile.exe someotherfile.dll The files data.zip and info.txt can ap...

Help me make my windows cmd.exe console work more like a Linux terminal

The windows terminal (the user-interface around text-applications like cmd.exe) really sucks. There is so much that the Unix-style terminals do that the windows terminal apparently cannot do, for example what if you want to re-size the window in both dimensions by dragging the border. The Windows terminal only allows you to change it's ...

create a program that can run a cmd prompt

I have a program that changes my desktop wallpaper by dragging the picture file onto it. I also have a wireless network program that can auto open programs everytime it connects to a certain network. I want to change my desktop everytime it connects to a certain network, but running the wallpaper program doesn't do anything unless I dr...