cmd

How to write console data into a text file in C++?

Hi All, I'm working on a file sharing application in C++. I want to write console output into a separate file and at the same time I want to see the output in console also. Can anybody help me...Thanks in advance. ...

Special characters won't work in MySQL (UTF-8)

So, I've had some issues while trying to come over from Latin1 encoded databases, tables as well as columns, and now that everything is finally in UTF-8, I can't seem to update a row in a column. I am trying to replace an "e" with an e with acute (é). But it gives me this: ERROR 1366 (HY000): Incorrect string value: '\x82m ...' for colu...

calling gawk from an R script

Hi i am using R on windows XP i have cygwin on my shell path what i want to do is send a command to gawk via R shell command this way: shell("gawk "{print $1}"", m[1],"_", h[i]."_79.7.dat""} i get this error Error: unexpected '{' in "shell("gawk "{" how can i fix this problem? Thank you ...

Java unicode characters error in cmd

I have the following class in Java which prints "Hello World" in portuguese: public class PrintUnicode { public static void main(String[] args) { System.out.println("Olá Mundo!"); } } I am using Eclipse, so I exported the project to a Runnable Jar File. After that, I went to cmd (Windows 7) and ran the generated jar fi...

Command Prompt and batch files

Hey all, I'm trying to copy a number of files from a directory. I want to include the file path from the base of this particular directory tree, however, I only have a list of the file names to go by. Is there a way to copy either: a list of files with their directories appended to the beginning in a .txt file a copy of the folders in...

Creating a simple finger application with batch

I would like to make a simple batch application that does two things. Asks the user to input a name, example "vega" Runs "finger [email protected]" and displays the output of that command. The following does the first thing, but I am not able to output the result from the finger. @ECHO OFF :begin echo Enter the name of the ...

Is there a way to automatically log onto a Windows XP machine at specific time?

How to set a specific logon time for a specific user on Windows XP? For example, the computer is an "always on machine" and most of the time no one is logged on. I want to set a time for my user to log on, without someone actually having to be in front of the machine. I've tried a workaround with the built-in auto logon function (control...

Android application uninstall batch/shell script?

I have developed a small application that consists of 5 different apk files. I'm developing on a lot of PCs and have a lot of developing phones. Every time I change the PC, the signature of the generated APK file is changed and I have to uninstall the applications on the phone. This is very time consuming. So is there a possibility to wr...

how to use ren/rename

Hi guys I want to rename all my avi videos. All the avi videos are in the current direcotry. I do it like this 'ren ./original.avi new.avi'. But it says the syntax of the command is incorrect. Thanks in advanced Zhong ...

Open two console windows from C#

[DllImport("kernel32.dll")] private static extern Int32 AllocConsole(); I can open cmd.exe with this command. But i can open only one console window and write in it. How can i open another one? Is any clean and fast solution for opening two console windows? ...

advanced grep(/perl)-like text-file processing on win32

To port a GNU makefile to the (non-cygwin) win32 platform, I am looking for a way to scan source files for the patterns such as '1234 // $RESOURCE$ "my_image.ico"', to then be appended to a resource file in the format '1234 ICON "my_image.ico"'. Using perl this is can be accomplished as such: perl -nle 'print "$1 ICON $2" if /([0-9]+)\s...

Cocoa application with an optional command line mode

I'm about to start a new Cocoa project from scratch and one of the requirements I have already been given is being able to choose either a Cocoa GUI or a command line mode from the same executable. Scriptability may be a possible addition in the future but that is not a concern right now. What is the best strategy for going about this ...

run/invoke windows batch script from sh or bash script

Hello, I have a sh/bash script that needs to call a batch file with parameters (parameters are file names and are given in DOS/Windows format). Basically I have: script.sh #!/bin/sh declare var1=$1 declare var2=$2 dosomething var1 var2 ... <invoke batch script> var1 var2 ... dosomethingelse I'm using GNU bash, version 3.1.0(3)-releas...

How do I open an Explorer window in a given directory from cmd.exe?

I see how to launch many other programs from a batch file, but I can't find a command like open on Mac OS X. Does such a tool exist on Windows? Powershell, or a Windows API call from an executable would also work. ...

Is it possible to use output redirections from a cmd file using start?

I want to have a cmd file with something like: :one start /wait (blabla1.exe -q -m 1>blabla1.log 2>&1) :two start /wait (blabla2.exe -q -m 1>blabla2.log 2>&1) where I want the output of the blabla application not the output of the start command. Is it even possible to have the redirections "local" inside the start command? Do I...

windows subcommand evaluation

linux & unix shells can process subcommands like this. $> command `subcommand` does windows cmd shell similar feature? ...

$cmd output in to a file

I have this below code: $cmd = system ("p4 change -o 3456789"); I want to print the output -description of the change list - into a file. $cmd = system ("p4 change -o 3456789 > output_cl.txt"); will write the output in to output_cl.txt file. But, is there anyway to get the output through $cmd? open(OUTPUT, ">$output_cl.txt")...

cannot create mysql database using cmd

I have this on my batch file: drop database if exists inventory; create database inventory; use inventory; mysql -u root -p inventory < C:\wamp\www\test\inventory.sql And I already copied all the contents of C:\wamp\bin\mysql\mysql5.1.36\bin Into C:\windows\system32 Just to make sure that it has the file that it needs to...

Spaces in batch script arguments

I have a batch script which needs to perform an action on each of its arguments. Each argument is a file name (there are not switches), and of course file names may contain spaces. The batch script is run either by dragging files into the .bat icon in Explorer or by entering the files at the command line, enclosing arguments with space...

Using the windows command line can I time a process that I am running?

I am running a process on a windows command line, it is going to take a long time (30+ hours) and I want to know how long it takes to complete. Is there a way to do this? ...