command-prompt

how to store a value returned from a sql query in a variable in batch programming ?

how to store a value returned from a sql query in a variable in batch programming ? i can invoke sqlserver queries from my cmd prompt using sqlcmd server name then the qwery this is query statement i m going to use SELECT CASE WHEN DATEDIFF(minute, record_timestamp, GETDATE()) < 10 THEN 1 ELSE 0 ...

Hiding Command Prompt with CodeDomProvider

Hi All I've just got my own little custom c# compiler made, using the article from MSDN. But, when I create a new Windows Forms application using my sample compiler, the MSDOS window also appears, and if I close the DOS window, my WinForms app closes too. How can I tell the Compiler? not to show the MSDOS window at all? Thank you :) ...

Copy contents of one document to another

Hi All, I am trying to copy the contents of one document and append it to another document through command prompt. It works fine for simple .txt file through the command (copy fileA.txt + fileb.txt). But when I try to copy the contents of a MSWord file to another MSWord file, it does not happen. Though the target file size keeps increasi...

How can I run a batch file silently?

I have a batch file with some commands that I need to run with my installer, but I'd rather a console not appear (in Windows). I'm executing the batch file from a WiX installer, via a custom action. I tried adding an @ECHO OFF to the top of the file, but that didn't seem to do anything. Is there a way that I can run this batch file sile...

Process.Start() get errors from command prompt window

Hello, I'm trying to Start command promt process with args. Now I want to obtain information about errors if they exist. someProcess = System.Diagnostics.Process.Start(cmd, someArgs); Best regards, loviji ...

Can Ruby access output from shell commands as it appears?

My Ruby script is running a shell command and parsing the output from it. However, it seems the command is first executed and output saved in an array. I would like to be able to access the output lines in real time just as they are printed. I've played around with threads, but haven't got it to work. Any suggestions? ...

Executing command line from windows application

Hello, i need to execute command line from .NET windows application. I tried with this code but i get error 'C:\Documents' is not recognized as an internal or external command, operable program or batch file. var command ="\"C:\\Documents and Settings\\Administrator\\My Documents\\test.exe\" \"D:\\abc.pdf\" \"C:\\Documents an...

how to activate 'more' option on command prompt (visual studio)

My code dumps a hell amount of data on the command prompt. How do I activate the 'MORE' option for the output so that I see the output page by page? (MS Visual Studio) For eg. Matlab has the command 'more on' to do the same! Thanks. ...

How do I make windows prompt RE-read environment variables?

Every time I modify the PATH environment variable, I have to close and re-open the prompt, is there a command to make my prompt refresh environment variables? ...

Runas Error: Unable to Acquire Password

I'm trying to start visual studio 2010 from command prompt using 'RUNAS' so that I can run it as a different user. I ran the following command: runas /profile /user:myPCName/SomeUserName "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" My problem is that the commandprompt says "Enter the password for myPCNam...

interactive window to execute dos commands in visual studio

Hi, I know using External Tools options i can run a batch script or a cmd prompt. But here is what i need to do I want to be able to call a dos prompt inside visual studio, which must be interactive. That way i won't be outside visual studio and can run all my dos commands in it. Is it possible? Or can i extend the command window and ca...

run nant build file in command prompt using c#

i have a build file with nant now all i need to do is execute it with command prompt using c# i tried the below but i am not able to build it .. pls help me its urgent.. thnaks in advance System.Diagnostics.Process.Start("exe -buildfile:d:\buildfile.build); and when i am runing through cmd prompt directly it is working ...

How to give permission to a directory using command prompt in Windows?

I have to give permissions (Read, Write, Modify) to a user to a directory using command line in Windows. ...

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

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

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

Changing to remove path from Env Variable PATH

Hi, I'm trying to use a command line implementation to change the Path env var to remove a path so I don't have to manually removed it on a bunch of machines. I have found this, which I can't seem to get it to work: %Path:str1=str2% str1 is the path and str2 is null, which I'm not sure how to set it to null on the command line. If the...

Replace all &#60; with < with perl on cygwin

I have Cygwin installed, I want to execute something like this on the command prompt: perl -pne 's/&#60;/<' input > output But I'm running into two separate issues with the & and < each needing to be escaped. something like 's/&/&' is an error at the perl level "Substitution pattern not terminated at -e line 1" something like 's/...

Visual studio command prompt without installing visual studio

is it possible to run visual studio command promt without installing visual studio? i want to install regasm.exe from the vs command prompt as our server is 64bit. And my requirement register using 32bit mode. ...

Running command line commands within Ruby script

Is there a way to run command line commands through Ruby? I'm trying to create a small little Ruby program that would dial out and receive/send through command line programs like 'screen', 'rcsz', etc. It would be great if I could tie all this in with Ruby (MySQL backend, etc.) ...