command-line

Windows Command Line Reference

Can you recommend a reference for the windows command line? I would like an exhaustive reference. Perhaps something along the lines of Unix in a Nutshell? I see that there is a Windows XP in a Nutshell - is that the same sort of thing? ...

How can I search for a multiline pattern in a file ? Use pcregrep

I needed to find all the files that contained a specific string pattern. The first solution that comes to mind is using find piped with xargs grep: find . -iname '*.py' | xargs grep -e 'YOUR_PATTERN' But if I need to find patterns that spans on more than one line, I'm stuck because vanilla grep can't find multiline patterns. ...

Are there any better command prompts for Windows?

For some reason the Windows command prompt is "special" in that you have to go to a properties dialog to resize it horizontally rather than just dragging the corner of the window like every other app. Unsurprisingly this feature made it into P-P-P-Powershell as well -- is there any way around this via command prompt replacement or Window...

Customized command line parsing in Python

I'm writing a shell for a project of mine, which by design parses commands that looks like this: COMMAND_NAME ARG1="Long Value" ARG2=123 [email protected] My problem is that Python's command line parsing libraries (getopt and optparse) forces me to use '-' or '--' in front of the arguments. This behavior doesn't match my requirements. An...

Is there a nice way of handling multi-line input with GNU readline?

My application has a command line interface, and I'm thinking about using the GNU Readline library to provide history, an editable command line, etc. The hitch is that my commands can be quite long and complex (think SQL) and I'd like to allow users to spread commands over multiple lines to make them more readable in the history. Is it...

How to check if a process is running via a batch script

How can I check if an application is running from a batch (well cmd) file? I need to not launch another instance if a program is already running. (I can't change the app to make it single instance only.) Also the application could be running as any user. ...

How do I Shutdown - Restart - Logoff Windows via bat file

I've been using Remote Desktop to get into a workstation but I'm not able to use the shutdown/restart function in the Start menu while doing this. I've put a few really helpful options in the answer below. As I cannot accept this answer, please vote up if you find it appropriate. Note: I wanted to make sure some really good answers ...

How do I concatenate files in a subdirectory with Unix find execute and cat into a single file?

I can do this: $ find . . ./b ./b/foo ./c ./c/foo And this: $ find . -type f -exec cat {} \; This is in b. This is in c. But not this: $ find . -type f -exec cat > out.txt {} \; Why not? ...

What is the command line syntax to delete files in Perforce?

I am creating some build scripts that interact with Perforce and I would like to mark for delete a few files. What exactly is the P4 syntax using the command line? ...

Commandline Jabber client

I need a simple scriptable/commandline jabber client. What is the best and/or simplest one to install? Clarification: I'm looking for a simple way to send messages from within a script. ...

Passing Command Line Arguments to internet explorer via VB

I've got an app that my client wants to open a kiosk window to ie on startup that goes to their corporate internet. Vb isn't my thing but they wanted it integrated into their current program and I figured it would be easy so I've got Shell ("explorer.exe http://www.corporateintranet.com") and command line thing that needs to be passe...

I can't seem to change drive drive using attached piece of code

y: &pause cd ptls5.0 &pause sdp describe Integration.dpk &pause z: &pause cd ptls5.0 &pause dir &pause I have those commands in the 1.cmd file. First three are executed fine. The result of it is that after "sdp describe Integration.dpk &pause" is executed I'm given "press any key to continue..." after I hit any key. The command prompt ...

Where to create temp files when access to /tmp/ is denied?

I wrote a short bash script to complete a task that involves creating a temporary directory and storing various files in it and performing various operations on it. In my first pass I just created the temp dir at /tmp/$$.$script", but then I tested the script on a computer where I didn't have write access to /tmp/, and I'd like to take ...

How to continue executing other processes in command line window after breaking a running process using C#

Hi Gang, I have written C# command window application. I'm running bunch of processes on command line inside the main(). For e.g. void main() { process p1 = new process() set p1 properties p1.start() -->p1.StandardInput.WriteLine("start /WAIT cmd.exe /c BUILD -cZP"); } This line will execute some program in a new command ...

What is the canonical way to determine commandline vs. http execution of a PHP script?

I have a PHP script that needs to determine if it's been executed via the command-line or via HTTP, primarily for output-formatting purposes. What's the canonical way of doing this? I had thought it was to inspect SERVER['argc'], but it turns out this is populated, even when using the 'Apache 2.0 Handler' server API. ...

Modern equivalent of javadeps?

I am looking for a replacement for javadeps, which I used to use to generate sections of a Makefile to specify which classes depended on which source files. Unfortunately javadeps itself has not been updated in a while, and cannot parse generic types or static imports. The closest thing I've found so far is Dependency Finder. It almos...

Are there any command line tools to generate windows icons?

I am working on a project that requires a number of icons generated from a set of source images. I have a script that generates all the required images with judicious use of ImageMagick, although I have not found a suitable tool to package the images as icons. I have a set of png files (from dimensions of 16x16 up to 256x256, and in a ...

how can I save the output of windows internal FTP client?

Hi, UPDATED: on win2k it seems it works OK. Sorry for the confusion. MS Windows Vista internal ftp client has a strange behavior. When redirecting its output and error to a file, the errors do not show up there: ftp -n -s:commands.txt host >output.log 2>&1 When running it from Task Scheduler inside a batch file, I don't get a...

PowerShell: CLI or GUI - which do you need or prefer?

PowerShell v1.0 is obviously a console based administrative shell. It doesn't really require a GUI interface. If one is required, like the Exchange 2007 management GUI, it is built on top of PowerShell. You can create your own GUI using Windows Forms in a PowerShell script. My question is, "What sort of PowerShell scripts or management t...

Passing a variable to dtsx package results in unexpected precedence constraint evaluation

I have a dtsx package with a precedence constraint that evaluates an expression and a constraint. The constraint is "success" and the expression is "@myVariable" == 3. myVariable is an int32, and when set in Visual Studio's design GUI the package executes fine. There are two other paths that check for the value to be 1 or 2. However ...