command-line

Can I use the command line, or run a batch file from managed code? (.NET)

Just like the subject states. I want to be able to run iisreset, batch files, etc. from the a console application. Can I/How do I do it? Thanks, Kyle ...

How can I set a temp directory for uncompleted downloads in Wget?

I'm trying to mirror files on FTP server. Those files can be very large so downloads might be interrupted. I'd like to keep the original files while downloading partial files to a temporary folder and once completed override local older versions. Can I do this? how? Is there another easy to use (command line) tool that I can use? ...

Hide Command Window of .BAT file that Executes Another .EXE File

This is a batch file in Windows. Here is my .bat file @echo off copy "C:\Remoting.config-Training" "C:\Remoting.config" "C:\ThirdParty.exe" This works fine except the .bat file leaves the command window open the whole time the "ThirdParty" application is running. I need the command window to close. I would use the short-cu...

How can I parse command-line switches in Perl?

In order to extend my "grep" emulator in Perl I have added support for a -r switch which enables recursive searching in sub-directories. Now the command line invocation looks something like this: perl pgrep.pl -r <directory> <expression> Both -r and the directory arguments are optional (directory defaults to '.'). As of now I simply c...

AJAX command-line interface in browser

I'm building a Web app to allow users to view and manipulate data, particularly numeric and geographic data. It's important that the output be clear and professional (data grids, Google Map overlays, etc.). But in terms of the user interface, I'd rather start with the flexibility of a command-line interface before building GUI-style form...

powershell script exits in "if" clause if run from command prompt

I am feeling surprised by the difference between two seemingly identical scripts. first.ps1: "A" if ($true) { "B" } "C" second.ps1: "A" if ($true) { "B" } "C" Now open a CMD window, and run these scripts like this: powershell - < first.ps1 powershell - < second.ps1 first produces: A B C while second produces jus...

Is there a way in a batch script to keep the console open only if invoked from Windows Manager?

I have a DOS batch script that invokes a java application which interacts with the user through the console UI. For the sake of argument, let's call it runapp.bat and its contents be java com.example.myApp If the batch script is invoked in a console, everything works fine. However, if the script is invoked from the Window Manager, the...

How can I write to the parallel port from the Windows Command line?

How can I write to parallel port through Windows XP command line? ...

full screen mode (25*80) command line scripting

when you run a script (such as vbscript) from 25*80 (full screen mode of dos prompt) and that your script call a windows application (such as notepad), at the end of the operation, focus remains on the desktop (although "command prompt" at the taskbar minimized and wait for only one "{enter}" to go back in 25*80 full screen command promp...

xargs doesn't recognize bash aliases

I'm trying to run the following command: find . -iname '.#*' -print0 | xargs -0 -L 1 foobar where "foobar" is an alias or function defined in my .bashrc file (in my case, it's a function that takes one parameter). Apparently xargs doesn't recognize these as things it can run. Is there a clever way to remedy this? ...

Equivalent of ctrl c in command to cancel a program

Hello, I am running a long program in a remote machine, and I want to stop it, but my problem is that if I use the kill command then the program will exit without saving results. Normally what I do to finish the program is using ctrl c and in that case the program saves the results, but right now I am not in the machine that is running ...

What does cmd /C mean?

I can understand cmd but not /c. I was trying to invoke a java program from the current for which I use Runtime.getRuntime().exec("cmd /C java helloworld") There arises my doubt. ...

cygwin interop questions

A quick couple of Cygwin questions that I am not quite sure how to search in order to find the answer myself: Question: When I run which perl on my cygwin installation, it doesn't point to my pre-installed windows installation, it points to the cygwin one. How can i change it so it points to my windows based perl installation: /cygd...

How to fix "assignment makes integer without a cast" **Update**

Okay here's the program I have typed up(stdio.h is included also): /* function main begins program execution */ int main (int argc, char *argv[]) { int x; /*first number input*/ int y; /*second number input*/ int sum; /* variable in which sum will be stored */ int product; /* variable in which product will be stored */ ...

BAT file to create Java CLASSPATH

I want to distribute a command-line application written in Java on Windows. My application is distributed as a zip file, which has a lib directory entry which has the .jar files needed for invoking my main class. Currently, for Unix environments, I have a shell script which invokes the java command with a CLASSPATH created by appending...

AJAX Progress: Reading output from the Shell

Hello all, Objective: Make a progress bar where users can check how much of a file has been downloaded by my server. Scenario:I have a PHP script that executes a python script via popen. I have done this like so: $handle = popen('python last', 'r'); $read = fread($handle, 4096); pclose($handle); This python script outputs to the s...

What is the best way to write a rakefile to run commands in windows?

As an example i want to run the following command under a rake. robocopy C:\Media \\other\Media /mir The rakefile i was able to get working was def sh(str) str.tr!('|', '\\') IO.popen(str) do |pipe| pipe.each do |line| puts line end end end task :default do sh 'robocopy C:|Media ||other|Media /mir' end Howeve...

Execute PowerShell Script from C# with Commandline Arguments

I need to execute a PowerShell script from within C#. The script needs commandline arguments. This is what I have done so far: RunspaceConfiguration runspaceConfiguration = RunspaceConfiguration.Create(); Runspace runspace = RunspaceFactory.CreateRunspace(runspaceConfiguration); runspace.Open(); RunspaceInvoke scriptInvoker = new Run...

How do I merge multiple PDB files ?

We are currently using a single command line tool to build our product on both Windows and Linux. Si far its works nicely, allowing us to build out of source and with finer dependencies than what any of our previous build system allowed. This buys us great incremental and parallel build capabilities. To describe shortly the build proce...

Shell output not being fully retrieved by PHP!

I have a PHP script which executes a shell command: $handle = popen('python last', 'r'); $read = fread($handle, 4096); print_r($read); pclose($handle); I echo the output of the shell output. When I run this in the command I get something like this: [root@localhost tester]# python last [last] ZVZX-W3vo9I: Downloading video webpage [la...