command-line

How to avoid the Windows (XP) Security Warning when launching a "DOS" command line within C#?

This question is related to this initial question asked a little while ago. Now, that I have chosen the extracting tool, I'm iterating through a given in command line parameter directory and subdirectories to extract the compressed .zip files. private static void ExtractAll(DirectoryInfo _workingFolder) { if(_workingFolder == null)...

Stop While true loop with a specific or any key pressed in a php script

Hi, I want to stop a while true loop when a specific or any key is pressed. I know I can ctrl-c the script but I am locking tables in my MySql database, and I doesn't want to unlock them in the beginning of the script because i want to be able to run multiple instance of the script. Thank you for any insight ...

Run a command as cron would but from the command line.

I have a script that I'm trying to run from cron. When I run it from bash, it work just fine. However when I let cron do it's thing, I get a: myscript.sh: line 122: syntax error: unexpected end of file What I want is a way to run a command as if it was a cron job, but do it in my shell. As a side note: does anyone know what would ...

Running matlab in the background

Hi, I am running matlab on 48 virtual machines and would like to automate it. I ssh into the machines then use matlab -r matlab_command > outfile.txt & to get the process to run in the background and run fine when I logout. The only problem is that when i jobs my process is stopped and won't start until I fg ^z bg. Is there a matlab f...

How do I get the name of the parent folder in a command prompt?

I'm in a Windows Command Line and want the parent folder in a variable. Assuming current directory is "C:\foo\bar", how can I get the value "bar"? I'm expecting something like a "find last backslash in CD and that's it". And please, no powershell references; I want plain old Windows Command Line operations. ...

running php script manually and getting back to the command line?

I'm running a php script via command line, and it works just fine, except that when it's finished, it doesn't go back to the command line? Just sits there, so I never when it's done... This is the script: $conn_id = ftp_connect(REMOTE) or die("Couldn't connect to ".REMOTE); $login_result = ftp_...

How to get an instance of instance System.Diagnostics.Process by processID on a remote machine

Hi all, I want to run & control a process remotely, I found the best way is the WMI APIs, The WMI gives me information about the remote process but I need more control like waiting it and getting the standard output and errors, how can I do that, and can I get an instance of System.Diagnostics.Process class by instance ID remotely? ...

send/post xml file using curl command line

How can I send/post an xml file to a local server http://localhost:8080 using curl from the command line? what command should I give? ...

How do I generate Entity Framework 4.0 classes from the command line that have different names than my schema objects?

I want to generate Entity Framework 4.0 classes from a (legacy) database from a command line, but I have 2 transformations I want: Tables/columns are lowerCamelCase and I want my classes/members to be UpperCamelCase. I want to suffix my classes with "Dto". Any idea how this might be accomplished? I'm a total newbie to EF, but I have...

Windows batch script to delete everything in a folder except one

I have a script to delete all subfolders and files in a folder: FOR /D %%i IN ("D:\myfolder\*") DO RD /S /Q "%%i" DEL /Q "D:\myfolder\*.*" And it works great! Only problem is that I would like to exclude one or more folders, like the XCOPY exclude feature. I just cant figure how I could add that to the script. ...

Playing Chess via SMS Messaging

I know there are some pretty nice open-source chess engines with powerful AI, like Crafty, that also have a nifty command line interface. I also know that I can send e-mails with my SMS-capable phone, and that I can reply to such an e-mail, and it will be sent to my phone as a SMS text message. Is there any way I can combine the two? ...

how to search for a term only in non test files

I use ack and I like it. However from time to time I need to search for something in my code base and I want to ignore all the files residing in test directory. Basically all the files which have test in their absolute path should be not included in the search. How do I achieve that? I am willing to have a custom bash script. Somethi...

VB.NET - Read lines from command line to Windows form possible?

Hey Overflow, I have an application which serves as a user interface for a spartan/command line program. I have the program running on a separate process, and my application monitors it to see if it is responding and how mush CPU it is utilising. Now I have a list of files in my program (listbox) which are to be sent to the application...

Command prompt print dialog command

Is there any way a C++ commandline program on Windows can produce a graphical GUI print dialog for printing to a printer, just like usual GUI programs? I've combed through this webpage and it seems there are only commands that print files in the background to a pre-determined printer. ...

Perl execution from command line question

I replaced ActivePerl with Strawberry Perl on my WinXP last week. I found I must run my Perl script with the command of perl myperl.pl; otherwise I only need run myperl.pl before install Strawberry. How can I only run myperl.pl as before? I checked my environment configuration as below. C:\> Path C:\Program Files\ActiveState Komodo ...

How can I get the process output error if it executed remotely

Hi all, I started a process remotely using WMI in a C# windows application, how can I get the output error for this process after finishing execution ? thanks ...

How do I create a scheduled task, via command line, which includes advanced options

I'm trying to create a scheduled task (in WinXP) which runs every 10 minutes, starting at 16:00:00 to 06:00:00, daily, from the command line. Currently, I can create a scheduled task which runs every 10 minutes, starting at 16:00:00, daily, by using the following command: SCHTASKS.EXE /CREATE /SC MINUTE /MO 10 /TN "Scheduled task name"...

xcopy file, rename, suppress "Does xxx specify a file name..." message

This seems pretty simple and maybe I'm just overlooking the proper flag, but how would I, in one command, copy a file from one directory to another and rename it in the destination directory? Here's my command: if exist "bin\development\whee.config.example" if not exist "TestConnectionExternal\bin\Debug\whee.config" xcopy "bin\de...

How to run a program without specifying the full path?

How come when I type "rails", it won't work... but when I type "/var/lib/gems/1.8/bin/rails" it will work? How do I bind it so that I don't have to type the full path everytime? ...

Cannot run Python script on Windows with output redirected??

This is running on Windows 7 (64 bit), Python 2.6 with Win32 Extensions for Python. I have a simple script that just print "hello world". I can launch it with python hello.py. In this case I can redirect the output to a file. But if I run it by just typing hello.py on the command line and redirect the output, I get an exception. C:> py...