batch-file

batch file for .png and Julian Dates

Hi, quick question. I have a .png format file in Julian dates as the name with sample included in the name . so something like 2006090sample.png. Right now I have a batch file that generates a name.txt file to show the name of the .png as a list For example: name.txt 2006090sample.png 2006091sample.png 2006093sample.png wanted to kno...

Why does the batch file crash?

I'm designing a chat for my school LAN network, it types your messages into a .dll file so as to disguise the chat log. The problem is that all of a sudden, whenever I started typing messages which have a space in them, the batch file crashes. For example if I enter the message as "h h" the batch will crash with the error: h==exit w...

Semantics of Windows batch programming redirection

I have a Windows batch script (my.bat) which has the following line: DTBookMonitor.exe 2>&1 > log\cmdProcessLog.txt So, from my understanding, this runs DTBookMonitor, redirects STDERR to STDOUT and then redirects STDOUT to the file log\cmdProcessLog.txt. I then run my.bat. DTBookMonitor runs for a significant amount of time, and wh...

Why my Backup Batfile can't work for some workstation on network ?

I have to manage system after old administrator. I have a problem about backup batfile because all workstation on network can backup but have only one can't backup,don't have any file in folder that difference from another workstation. (i add batfile in scheduled task for run everyday) and I don't know why.I view code for get help ...

SQL Server 2008 - use cmd to output with headers to .csv

Hi all I have a pretty simple question (and these are typically the ones I spend most of my time tearing my hair out about). I am using a batch file to execute all the .sql queries that are in the same directory as the batch, and to save all their results to various .csv file. Here is my code: @echo off REM Check that all parameters ...

Remove an 'Equals' symbol from text string

I'm running a WMIC lookup against a series of remote client machines, pulling in Model and serial number. For /F "tokens=*" %%b in ('wmic /node:%device% computersystem get Model /value^|find "Model"') do Set model=%%b FOR /F "tokens=*" %%c in ('wmic /node:%device% bios GET serialnumber /value^|find "SerialNumber=" ') do set Seri...

How to write a batch file that will open a program on startup?

At work we need to login to pidgin (the mozilla instant messenger) as soon as we start our computers. But I sometimes foget to manually login. Pidgin is setup in such a way that the password is stored, so all I need to do is click on the icon and I'm logged in automatically. So is there a batch file that can "open" the program as soon a...

Batch script cannot open IE

I have a batch script which needs to be executed by a third party application in Win 2008 server machine. The contents of the batch file is as follows: @echo off dir C:\ > D:\newfile start "C:\Program Files\Internet Explorer\iexplore.exe" www.google.com Whenever my application runs the batch file, the file "newfile" is created, but I...

dos batch : using double quotes with IF

I have a DOS-batch like this : @echo off if "%1" == "%2" GOTO next echo different goto end :next echo same :end Are the double quotes surrounding %1 and %2 necessary ? In which case are they useful ? ...

Setting a system environment variable from a Windows batch file?

Is it possible to set a environment variable at the system level from a command prompt in Windows 7 (or even XP for that matter). I am running from an elevated command prompt. set name=value seems to be only valid for the session of the command prompt.. ...

Automate cygwin via batch file

Hi guys, Long story short... we have multiple servers which we run perflog monitoring on every night. My job is to convert these logs to .csv format and send them to my e-mail. This bit it already automated via a .sh script an ex-employee wrote. What I want automated is to run a batch job after the perfmon logging to look at a specifi...

Error connecting to linux server using batch file. Able to connect with Filezilla

I am trying to connect to a remote servre via FTP in my VB 6.0 application. I tried connecting to remote server using Inet but it gave status unknown error (code:120089). So I am trying to do this by batch file. I created a batch file as below:- open 192.168.1.3 22 root !@#%RedHat%)(* cd "/opt/test" put "C:\envars.exe" "envars....

How to create batch file for delete sub floder

i want to delete sub folder and item in sub folder for example i have f:\ComSvr01\Trend(month_09.10 , month_08.10 ,...)\t1.trd i want to delete all folder month_mm.yy and item in folder but remain folder name Trend (f:\ComSvr01\Trend) How to do? help me please ...

How to get parameter in a .bat file from a java project

Hello! Yesterday I asked this post, but I am still having problems when I try to run this .bat file from my java project. @echo off set filename=%1 echo %filename | sed 's/\([A-Z]\)/ \1/g'; The call I do is: String param = "myparam"; ProcessBuilder pb = new ProcessBuilder("myFile.bat", param); But what myFile.bat does is just pri...

Include a batch file in a batch file

Hi I have a problem calling a batch file from another batch file when trying to run everything by using Process.Start. Basically I call the execution of a batch file from my c# program that looks like this: call include.bat //execute the rest of the batch file here The include.bat file sets up paths and can be used by a numbe...

How to get the path of the batch script in Windows ?

I know that %0 contains the full path of the batch script, e.g. c:\path\to\my\file\abc.txt I would path to be equal to c:\path\to\my\file How could I achieve that ? ...

How to check in batch script if "mysqldump" and "mysql" commands succeeded or not ?

I'm running mysqldump and mysql commands from a batch script on Windows to make a backup of a database and restore it. How could I check in the batch script whether these commands executed correctly or end up with error ? In case of error, I would like to know what the error is. Thanks ! ...

Strategy for Stopping Java Processes in Windows XP

I am working with an application that consists of 10 or so Java processes that communicate through JINI, JMS, Sockets, and an HSQL db running on Windows XP. It seems that each part of the application has its own .bat file. For instance there is: ActiveMQ Broker HSQL Server JINICore Services RMI Registry 5 Java mains that run 1 Java G...

bat read a file line by line

In my bat script, is it possible to access a txt file and read it line by line. The idea I'm having is to check if the line starts with an identifier word (in my case 1 or 2 stars * or **) but to do this I need to read the file line by line. ...

Need help with writing a batch file

I'm writing a batch file on Windows which gets one argument: a zip file name that was created with 7-zip. This file contains a single MySQL backup file inside, say backup.sql. I would like to restore the database given this zip file. So, first I extract it to a temporary directory like this: path_to_7zip\7z e "%~1" -otemp_dir And n...