command-line

get the latest folder in directory

I am using dir /B /A:D /O-D /TC to get the list of Directories. I need the first result returned by this result. I tried looping and setting the first one, but I dont know how to break out of the loop after taking the top result. Please help. @echo off FOR /F "tokens=*" %%G in ('dir /B /A:D /O-D /TC') DO (set latest=%%G) echo %latest...

SDelete called from asp.net page

Hello, I want to use SDelete after some code is run on an asp.net page. SDelete is a command line tool. My specific question is has anyone been able to run this SDelete from an asp.net page? More generic question would be, how do you run a command line utility from an asp.net page? thanks ...

How do I write an error out to the client in a cmd line pre-commit hook app?

I'm writing a pre-commit hook in C# and I know I have to return 1 for failure and 0 for sucess, but I cant get it to write any message out to the client. Currently I'm using static int Main(string[] args) { var repository = args[0]; var transaction = args[1]; // TODO: do stuff and return 1 or 0 appropriately ...

shell script to quickly jump to a directory

I am using mac. When I do p demo on my terminal then I want to go to cd /Users/dorelal/prod_demo I tried adding following commands to my ~/.bashrc but none of them worked. alias p='cd /Users/dorelal/prod_$1' function p { cd '/Users/dorelal/prod_$1' } ...

linux command line, password protect file using script

Hi Everyone, really new to linux scripting so i figured i would ask rather than waste time pulling my hair out. i have a simple script that backs up the contents of a folder on my linux box and moves it to S3 storage, i would like this script to create a zip file and password protect it without any intervention from me. i got it down t...

process.start() arguments

when i do the following command into dos it will work fine ffmpeg -f image2 -i frame%d.jpg -vcodec mpeg4 -b 800k video.avi When I try to use the process class in c#, without the arguments, it loads ffmpeg in a console window then dissapears like usual. However, when I try to use the argument as I do above, formatted exactly the same.....

grep - put part of string into variable

Hi there. I'm using swfdump to be able to get the ID number of an audio file. Here is what I'm using: swfdump -D /Users/home/folder/file.swf | grep -i mp3 That is outputting: [00e] 28999 DEFINESOUND defines id 0006 (MP3 22Khz 16Bit mono) What I need is the id #..in this case it is 0006. i want that number in a variable. Anyone kno...

non-IDE C development environment

How do I set up a non-IDE-based C development environment on Linux? ...

Running a Java 3D program from the command line

I recently installed java 3D in my computer and it all the progras which I created worked from the NetBeans IDE. However when i set the path in the command line, it says that javac is not ercognised. I set the path to, C:\Program Files\Java\Java3D\1.5.1\bin and then typed javac FirstProgram.java I got the following mesage (please help)...

Command Line in R code

Hi all, Let me start by saying I am new to programming. I am hoping to run a python script from the command line within an R script. I am running windows xp but also have a machine that runs Windows 7. I can run the following code without error for the dos-prompt. cd C:\Documents and Settings\USER\workspace\UGA - Website python test...

starting Matlab script from command line doesn't find DLL on the path

I have a Matlab script that requires a function in a DLL, and calls addpath to put it's location on the path. This works fine, but when I try to invoke the same script on the command line with matlab -r "scriptname" it errors out saying that method is undefined. Is there something different happening when I'm starting from the command li...

Start a groovy script directly from its url

I have a script that is available on the web, and I want to run it directly by entering its url, instead of downloading it and running later. Is there a way to do it ? ...

Mercurial/extdiff not changing to temp dir (as I THINK it's supposed to)...

Using Windows, Mercurial, and the extdiff extension (for Mercurial). I was trying to set up extdiff to use WinDiff as an external diff tool, but I think I've narrowed the problem down enough to say that the trouble is before I'm even getting that far. From what I understand of extdiff, it merely calls your cmd.winmerge program, and pas...

Why did SQL Server Management Studio 2008 command-line switches stop working?

I've always relied heavily on Windows shortcuts to SSMS that include command-line switches allowing me to quickly open up a specific database on a specific server. For example Ssms.exe -S 123.123.123.123 -U sa -P goodpassword -d DbName or Ssms.exe -S . -E -d DbName These suddenly stopped working. I get this error from SSMS: Faile...

How do I execute WinZip from Visual Studio without it's GUI opening?

int sysReturn = system("\"C:\\Program Files\\WinZip\\winzip32\" -a C:\\LOG\\test.zip C:\\LOG\\LOG_7-20-2010_17_8_48_834.csv"); Everything seems to work - as in it creates test.zip However, it opens the WinZip GUI (that shows how much has been compressed, etc while my program is running.) How can I skip that part where it doesn't ope...

sed beginner question: capturing groups in sed

I have many lines of the form ko04062 ko:CXCR3 ko04062 ko:CX3CR1 ko04062 ko:CCL3 ko04062 ko:CCL5 ko04080 ko:GZMA and would dearly like to get rid of the ko: bit of the right-hand column. I'm trying to use sed, as follows: echo "ko05414 ko:ITGA4" | sed 's/\(^ko\d{5}\)\tko:\(.*$\)/\1\2/' which simply outputs the original string I ech...

C# command line project - Error when run via .exe

I have a C# project that compiles normally. When I run the project via Visual Studio's IDE it runs fine and ends cleanly. However when I navigate to the project directory and attempt to run the program by double clicking the "exe" file or referencing it via the run window it errors out. I have narrowed the problem down to Console.Wri...

Can two windows apps communicate using the command-line?

I worked on a Unix app where two applicants ran and talked to each other using the command-line, i.e each had a loop something like (treat this as pseudo code): bool stop=false; do { stringstring cmdBuffer; cin >> cmdBuffer string ret = processCommand(cmdBuffer); if(ret.length()==0) stop=true; else cout << ret; } while...

Open Media Player with Playlist from Memory

Hi, is it possible to open the windows media player from a c# application with a self generated playlist from memory. So that I don't have to save the playlist on my storage first and the open the player with the playlist file. I don't really what to save a playlist for each temp. user selection. OR Is it possible to open the windows ...

Why does my command line application error out on remote assembly when ran outside Visual Studio?

I have a very simple command line .net application. I have reference to a .dll assembly and everything works just great when I run the program inside Visual Studio. However when I try to double click the .exe file or run it manually via DOS or something it error out saying it doesn't have access or can't find my assembly reference. Wha...