cmd

Robocopy File Transfer Backup using SQL Server.

I have a job running robocopy to copy files from the SQL server to a backup drive. The job runs a CmdExec type job to call a batch file that runs robocopy. my issue is although the files copy over fine the error reports dont get registared I tested this by changing the source file to a bogus drive. It still reports job success. I have ...

List all tags within a module in CVS in CLI

Is it possible to get a list of all generated tags for a given module in CVS? I can use cvs status -v FILE but it shows too much information that I just don't need. I can use some gui utilities that show me only the tag names (Eclipse is one of them), how do they do it? You need to do some "hacks" or are just parameters I'm unaware ...

Parallel/Multithread in CMD

I need to run a counter and a timer at the same time, but I'm not sure about how to achieve it. I have a batch file that counts the number of times any key is pressed in an easy loop made by a goto, once its done (keypress) for the first time, it fires a timer for 1 min; the key pressed in that time, must be stored in another variable...

Spaces in IN clause of BAT file for loop

Hey all- I'm trying to run a command on all lines of a txt file through a batch file. I'm struggling to escape the characters in the IN () clause of the for loop. This works: for /F %%i IN (C:\test.txt) DO echo %%i These don't: for /F %%i IN (C:\Documents and Settings\user\Desktop\test.txt) DO echo %%i for /F %%i IN ("C:\Document...

SCP from Windows using the colon-inclusive full path

Hey- I'm trying to run SCP on my Windows box through a batch file. I want to do something like: scp "C:\myfile.txt" user@host:path Of course scp thinks that "C" is my source host and "\myfile.txt" is my source path. I can't seem to find a way to escape the colon. These don't work: scp "C\:\myfile.txt" user@host:path scp "C::\myf...

Can a batch file execution step through sequence without completing a java process?

Does a batch file execute processes in sequence only if the previous step has completed and released all file/process locks? Suppose I have the following cmd file (mybatchfile.cmd) echo. |TIME java myjar.jar echo. |TIME and I pipe the results to a log file. Can I be 100% confident (on windows) that my java process has completed and...

Reading lines from a text file in batch file

I know this has been asked 100 times before but every bit of code I try just doesn't seem to work. I am trying to compile a file and then check for a error file and read it line by line and dump it into command line: This is what I have so far: Set var1= %1 Set var2= %var1:.mb=.ERR% echo %var1% echo %var2% "C:\Program Files\MapInfo\...

CMD - how to write %

Hi, I am using windows cmd and i am trying to do the following: REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug" /v debugger /t REG_SZ /d "%ENVIROMENT VAR%utils\cdb.exe -pv -p %ld -c """.dump /u /ma c:\utils\1.dmp;qd""" " As you see, first enviroment varialbe is between % and is expanded by cmd, then %ld should ...

opening cmd prompt and execute command java

I was able to open a command prompt from my Java program with the following code: String cmd = "C:\\WINNT\\system32\\cmd.exe /c start"; try { @SuppressWarnings("unused") Process ps = Runtime.getRuntime().exec(cmd); } catch (IOException e) { e.printStackTrace(); } The above code opens the command p...

[c/c++] set variable to cmd.exe

Greeting earthmen, Here is my question: How can I create a program which sets variable to current session of cmd.exe e.g. c:\> set myvar Environment variable myvar not defined c:\>myexe.exe c:>set myvar myvar=myvalue The only similar topic that I've found is this - http://stackoverflow.com/questions/774047/how-can-i-change-windows...

%CD% variable behaviour differs when right click and use run as admin

I have a windows cmd file that is making use of the %CD% environment variable to determine the execution directory of the cmd file. When I run the cmd file from the command line it works correctly, meaning that the %CD% variable contains the working directory. If I double left click the cmd it also works as I expect. However if I right ...

starting TS and TSNoise via batch and closing TSNoise when TS is quit

ok, i know how to start both programs parallel, but i'd like to make TSNoise close on closing TS. atm my .bat is this: @ECHO OFF start /b E:\Programme\teamspeak2RC2\TeamSpeak.exe start /b I:\Programme\TN1.0.4\TS-NOISE.exe ECHO. EXIT ...

batch abnormal exit

Can I check why does my command prompt closes when i execute this line? for /f "tokens=1 delims=: " %%A in ('call who') do set nowuser=%%A The script is working fine on other system except one where the script exit abnormally. I debug the batch and found out this line causes the command prompt to close totally. Is there any settings i...

How to view the method members of a class within a jar file thru the command line

I am trying to look at the method members of a class within a jar file. Currently to list all the classes within a jar file, one can call this command: jar -tf myjar.jar but if i want to list the public methods within a particular class in this jar file, How do i go about it. Thanks ...

DOS Batch file issue with ampersand & in an input record.

I've creating a dos batch file to process a file of input records. I've cut out the majority of the code, so here is the problem. When it reads the 3rd record, with the ampersand, the job does not write the output record, UNLESS i put double quotes around the %%H variable. However, when I do this, it adds the " to the first and last b...

windows command promt zip/compress directory

Is possible to compress/archive a directory with all of its sub-directories and files in a single file from cmd.exe ? I know there are a lot of utilities available but I need to perform the operation only with the windows default utilities . I'm running windows server 2003 . ...

Using PHP doctrine CLI easily in windows

in windows, to use doctrine CLI from any directory i need to use something like php D:\full\path\to\doctrine\bin\doctrine.php --variables here is there anyway i can shorten this so that it becomes something like php doctrine.php --variables here or even doctrine --variables here ...

How to write console output to a text file in cpp?

Hi All, I'm trying to write console data into a separate text file in cpp. Anybody help me with sample code. ...

Launch remote assistance request?

I'd like to make a button or link that launches a remote assistance request to a designated computer. Is it possible to just do this through the command line? If not I'll use vb.net. Thanks! ...

How can I escape an exclamation mark ! in cmd scripts?

When I have setlocal ENABLEDELAYEDEXPANSION set in a cmd script is there any way I can escape a ! that I want to use as a parameter to a command? @echo off setlocal ENABLEDELAYEDEXPANSION echo I want to go out with a bang! echo I still want to go out with a bang^! ...