cmd

how to run a program from cmd in C#

i need to run a program from the cmd, how can i do it in c#? ...

Removing double quotes from variables in batch file creates problems with CMD environment

Can anybody help with effective and safe way of removing quotes from batch variables? I have written a batch file which successfully imports a list of parameters %1, %2, %3 etc. and places them into named variables. Some of these parameters contain multiple words, and therefor are enclosed in double quotes. > "Susie Jo" (%1) > "Smit...

CMD: Delete files/subfolders in a specific directory

Hello, Can someone help me with something I want to achieve in CMD? Say, there is a variable called %pathtofolder%, and, as it makes clear; it is a full path to a folder. Now, what i want to do is, to delete every single file and subfolder in this directory. But not the directory itself. But, there might be an error like 'this file/f...

Skip when error occurs

Hello, i have the following code in batch (cmd): for /f "delims=" %%f in ('dir /b /s Example') do ( command if %errorlevel%==1 ( command SKIP ) command ) EDIT: To make things more clear: for /f... searches for a directory called 'Example' and loops to search for more directories than one. the first command is a delete command, it dele...

JAVA Newbie Alert: Trying to run Java class and getting ClassNotFoundException

Java newbie. I am trying to run a java main class from cmd line and getting back ClassNotFoundException: java -cp class c:\development\eclipse\workspace\Library-Manager-Server\bin\demo\rmi\librarymanager\server\LibraryManagerServer -Djava.security.policy="C:\Development\Eclipse\Workspace\Library-Manager-Server\security.policy" -Djav...

How to pass parameters to mysql

Hello all, During the installation I need to create new MySQL user, new database and populate it from dump file. My question is how can I do it from command line (cmd, Windows)? I mean, I'm calling for cmd from some script, which can start mysql command line client with root privileges but I cannot pass parameters to mysql form outside....

cmd: variable of open with

Hello, When, for example, i want a batch file to 'open' a file. when i for example drag and drop the file into the batch file, it should do some stuff with that file. Now, i need to know the variable. I know there is a variable for this kind of stuff; i just forgot it. Can someone give me the variable please? Thanks. ...

cmd: unexpected error with @pause and path>txt

Hello, I am coding a batch file. Here is a sample: if exist rootsys.txt del rootsys.txt if %lang%==1 ( if %bit%==32 echo C:\Program Files\path\to\the dir>rootsys.txt if %bit%==64 echo C:\Program Files(x86)\path\to\the dir>rootsys.txt goto :waset ) This goes on for six times (so if %lang%==2 etc... to if %lang%==6.) So, what it does,...

batch/CMD move does not work with folders

Hi everyone. I have a simple .bat (move.bat) file in the SendTo folder which moves files and directories from any location to a specified folder by using the context menu. This worked on XP. In Windows 7 however i get an access denied error. It doesn't even work with cmd opened as admin (runas). content of move.bat: move %1 c:\specified...

CMD: Fails with %1

Hello, Recently i posted a question about what the variable is of a file which you open with a batch file, which is %1. I used this, to let my batch file copy %1 to a specific location. After doing this, debugging and a lot of time, and it actually worked, after debugging it more, adding some features, and some more debugging, it stopp...

CMD: Check for quotes

Hello, Let's say, the user drag and drops an file into my batch file, which causes that the batch file copies the file to a certain directory. the problem is the following command: copy "%1" "C:\path\to\it" The problem here is the quotes around%1. When you drag and drop something in a batch file, normally, it wouldn't put quotes, so ...

CMD: Bat to Exe Converter - Temp directory problem

Hello, i am using 'Bat to Exe Converter' to convert my batch files to exe format. Now, i am running into some problems. Whenever i convert something, and i set 'Working Directory' to 'Current Directory', and i start my exe in echo on mode, this is what i end up with to check if there is a specific file in the directory of my exe: the ...

Long lines all messed up on a console application

I'm trying to use a text-to-speech engine, festival, in Windows. I found a pre-compiled binary online, so I can't really re-compile without a whole lot of effort. Here's what happens. I run the program from cmd.exe and try to see the definition for a function: festival> utt.synth #<CLOSURE (utt) (begin "(utt.synth UTT) The main ...

how to get/strip the name a batch directory

i want to raname files in a dir based on the name of containing dir. like c:\bin\data01\foo.txt to c:\bin\data01\data01.txt following http://stackoverflow.com/questions/659647/how-to-get-folder-path-from-file-path-with-cmd ...

Call URL with wget and return an ERRORLEVEL depending on URL's contents

A client has a Windows based in-house server, on which they edit the contents of a CMS. The data are synchronized nightly with the live web server. This is a workaround for a slow Internet connection. There are two things to be synchronized: New files (already sorted) and a mySQL database. To do this, I am writing a script that exports ...

How to execute a windows batch command recursively?

For example, you have a rename command in a batch file, and you want to execute that file on the current directory and all sub-directories. ...

why did sqlcmd -v foo="c:\path" eat the "c:"?

I have foo.sql as: print 'foo=$(foo)' Then I have in foo.cmd the following shell script: sqlcmd -i foo.sql -v foo="c:\path" Running foo.cmd prints: foo=\path how do I escape the "c:"? Is dos-shell eating it, or is it sqlcmd? ...

Is there an interface to cmd.exe

Hi , I try to wrap the cmd.exe console and would like to be able to use the underlying command interpreter to be run by my app. This will allow me for ex to execute dynamically created script and other thing ( the question is not about how to do execute dynamically created script , but about getting an interpreter loop around the diffe...

how to run multiple batch files in serial, in windows command line environment

I have a batch file, bat1.bat bat2.bat but it stops at the end of bat1 any clues? ...

CMD.exe C# Emulator?

I've been trying very hard to automatically ssh into a Linux server. What's crazy, is that I can create a .bat script, that will do it, but I have to be there physically, to type in the password. I've tried automating this using System.Diagnostics.Process object in c# to no end. There is no way, I've found, to make this object allow you...