cmd

Can I mask an input text in a bat file

I am writing a batch file for execute some other programs. In this case I need to prompt for a password. Do I have any way to mask the input text. I don't need to print *** characters instead of input characters. Linux's Password prompt behaviour (Print nothing while typing) is enough. @echo off SET /P variable=Password : echo %vari...

Show the CMD window with Java

I'm using this code to launch a .cmd file: try { String line; Process p = Runtime.getRuntime().exec(myPath + "\\punchRender.cmd"); BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); while ((line = input.readLine()) != null) { ...

Redirecting output to multiple files and to stdout simultaneously in win XP command line

I would like to redirect the output from a command to a file and to stdout. I am using Windows XP command line. I realize that there is a command in linux called tee which will do this, but I want this in windows. ...

Display CMD output in my GUI (java)

How might I get the output from a CMD process to display in my GUI? This is the code I'm using to run the process: try { String line; Process p = Runtime.getRuntime().exec("cmd /c \"e:\\folder\\someCommands.cmd\""); BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); while (...

Batch file for opening most recent Malwarebytes' Anti-Malware Log

In Vista, I want to run a batch script to open the most recent file, based either on last modified date, or the date in the filename. It's for Malwarebytes' Anti-Malware logs in the %username&/appdata/roaming/Malwarebytes/Malwarebytes' Anti-Malware/Logs folder. Log files are in this format here mbam-log-2009-03-21 (00-20-21).txt ...

How can I extract a full path from the PATH environment variable?

I want to extract a full path from the PATH environment variable with native cmd tools. Consider the following PATH content: C:\Program Files\Windows Resource Kits\Tools\;C:\Perl\site\bin;C:\Perl\bin;C:\WI NDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Program Files\Microsoft SQ L Server\90\Tools\binn\;C:\WINDOWS\system32\...

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

How to measure execution time of command in windows command line?

Can this be done with standard means? ...

Running cmd commands via .NET?

System.Diagnostics.Process proc0 = new System.Diagnostics.Process(); proc0.StartInfo.FileName = "cmd"; proc0.StartInfo.WorkingDirectory = Path.Combine(curpath, "snd"); proc0.StartInfo.Arguments = omgwut; And now for some background... string curpath = System.IO.Path.GetDirectoryName(Application.ExecutablePath); omgwut is something l...

Vista Recycle Bin Maximum Size

Does anyone know how to set the Maximum Size of the Recycle Bin via script? Whether its written in batch or vbs or just a reg file? I've been exploring this idea for the last few days, and can't get an answer. Maybe someone here knows how. I'm wanting to add it to my Vista Cleanup Script =) ...

how do i get rid of mid spaces in an environment variable

how do i get rid of mid spaces in an environment variable suppose i have the following for loop fragment that get free disk space size of a certain disk for /f "tokens=3" %%i in ('dir ^| find "Dir(s)"') do set size=%%i would result something like this C:\>set size=129,028,096 i wanted to get rid of delims as follows for /f "deli...

navigating through different drive letters in python os.system

I am having a problem with a bit of code on one windows machine but not all windows machines. i have the following code: path = "F:/dir/" os.system(path[0:2] + " && cd " + path + " && git init") On all but one of my windows systems it runs fine but on a windows 2003 server it gives a "directory not found" error but if i run the same c...

indentation of multiline string

I have a script that uses the cmd Python module. The cmd module uses a triple quoted multiline string as it's help text. Something like this def x(self, strags = None): """class help text here and some more help text here""" When running the script, the command 'help x' will print the string. It will, however, print the ne...

Command Line Compiling a Win Forms C# Application

I'm trying to create a script to compile an Windows Forms C# 2.0 project from the command line (I know, I know.. I'm reinventing the wheel.. again.. but if somebody knows the answer, I'd appreciate it). The project is a standard Windows Forms project that has some resources and references a couple external assemblies. Here is a list of...

Listing files in recycle bin

Hi guys me again :) I'm wanting to list the files that are in the recycle bin in Vista from the command line. So far I have this.. dir C:\$Recycle.Bin /s /b >> recyclebin.txt That does alright, the output I get is this.. C:\$Recycle.bin\S-1-5-21-931442927-344369455-2477061601-1000\$I2H8K48.zip C:\$Recycle.bin\S-1-5-21-931442927-...

Matlab on cmd (winxp)

I've just started experimenting something with Matlab, and since I'm used to Vim's interface, I try to stay out of Matlab's editor as much as possible. What's troubling me is that every time I start a .m file, it brings up the interface. Is there a way to start test.m from a cmd line, and let it give output out on a cmd, as it would nor...

I want to delete all bin and obj folders to force all projects to rebuild everything

I work with multiple projects and I want to recursively delete all folders with the name 'bin' or 'obj'. That way, I am sure that all projects will rebuild everyhing (sometimes it's the only way to force visual studio to forget all about previous builds). Is there a quick way to accomplish this (with a bat file for example) without ha...

Is there a way to indicate the last n parameters in a batch file?

In the following example, I want to call a child batch file from a parent batch file and pass all of the remaining parameters to the child. C:\> parent.cmd child1 foo bar C:\> parent.cmd child2 baz zoop C:\> parent.cmd child3 a b c d e f g h i j k l m n o p q r s t u v w x y z Inside parent.cmd, I need to strip %1 off the list of para...

Setting a variable from an executable

I am running an executable in a batch file with two parameters; cmd /k ""executable" "param1" "param2"" This returns a string that I want to launch. I can't figure out how to set this return in a variable and subsequently launch it in IE. Any ideas? ...

How can I change Windows shell (cmd.exe) environment variables from C++?

I would like to write a program that sets an environment variable in an instance of the shell (cmd.exe) it was called from. The idea is that I could store some state in this variable and then use it again on a subsequent call. I know there are commands like SetEnvironmentVariable, but my understanding is that those only change the va...