batch-file

Batch file doubts

Hi all, This is a doubt regarding a test.bat file which opens a particular .exe file which is corresponding to my application.So now i am able to open it successfully.But i get stuck up in the next thing which is it should open the File option present in the .exe window IDE and load a .cfg file and then it should open a 'Genera...

How to SET a variable to the path of parent directory on windows?

Hello, Struggling with command line again, I have figure out that I can store the current working directory in a variable like so: SET current=%cd% How would I set parent though? SET parent=%..% does not work, as it echoes %..% Basically, calling a batch script C:\a\b\myscript.bat with the following contents: @echo off set current=...

Number of tokens limit in a FOR command in a Windows batch script

Hello, I was trying to process a text file in a Windows batch script and I ran into something that looks like a limitation to 31 tokens in a FOR loop. I isolated the issue in the code below: @ECHO OFF SET DATA=01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 FOR /F "tokens=31* de...

write a batch to change the path for Mapped drive.

I having server folder as a mapped network drive in workstation . Now the that folder is shifting to to another server so Ineed to change the path this activity I need to do at 400 workstations. so can you help me with script. ...

Quickly create large file on a windows system?

In the same vein as http://stackoverflow.com/questions/257844/quickly-create-a-large-file-on-a-linux-system I'd like to quickly create a large file on a windows system. By large I'm thinking 5GB. The content doesn't matter. A built in command or short batch file would be preferable, but I'll accept an application if there are no oth...

How can I check a checksum in a batch file?

I want to create a batch file which only continues if MASTERRESET.DLL consists of the following lines: ih7rhj49g9r0390jf89j39hfj439jf948hf89h3j89fj98rh893f893b9bf983b89bf89rhf89hr89fh389h9hr893rr 0jf3rj09ihf3hr9f8987743h9voirjf893hfh3hf03j03fjfe00fej33893uo34h83484fb3iuu3f94hf4hr8h498r94 I just want the batch file to check the .d...

How can I emulate End Process Tree in C#/.Net

We have a web application that has to launch other processes. Typically these processes are batch files that launch a series of other processes. Sometimes we need to kill a batch file process that is running and to do that we need to kill it and its children. What is the best way to go about this in .Net? ...

Help with SQLPLUS please? How to make SQLPLUS startup with DEFINE `OFF` initially?

I have a batch script that invokes PLSQL with connection details, which works fine but I still have to explicitly SET DEFINE OFF when I connect. I would like to enhance my simple batch script to pass the SET DEFINE OFF command to SQLPLUS so that once I am connected, I will no longer have to issue that command manually. echo set define o...

How do you have a called bat file not kill it's calling bat file?

I am on a Windows 2003 system and need to script the deletion and creation of a profile in WebSphere Application Server. This requires me to call manageprofiles.bat twice, once to delete the existing profile and once to create a new profile. In my batch file, I have the following: cd "C:\Program Files\IBM\WebSphere\AppServer\bin" mana...

cruise control -how to execute batch file in cruise control and how to publish in different folder using cruise control

1.I am getting below errror while executing batch file in cruise control: code which i used is <exec> <executable>D:\DITBUILT.bat</executable> </exec> 2.I want to publish in different folder using cruise control.. I am using the code... I am not able to publish in different folder C:\WINDOWS\Microsoft.NET\Framework\v2.0....

Call Python From Bat File And Get Return Code

I'm looking for a way to call a python script from a batch file and getting a return code from the python script. Confusing I know, but it's based on a system that's currently in use. I'd re-write it, but this way would be much, much quicker. So: Bat ---------------------> Python * call python file * Bat <----------------------...

heredoc for Windows batch?

Is there a way of specifying multiline strings in batch in a way similar to heredoc in unix shells. Something similar to: cat <<EOF > out.txt bla bla .. EOF The idea is to create a customized file from a template file.. ...

SourceSafe backup script - best approach?

I was wondering what the best approach might be for creating a backup of my organisation's SourceSafe database, and moving it to a share on another server? Currently we have a scheduled job which runs a batch file, which in turn executes a PowerShell script. This Powershell script creates a backup file (using SourceSafe command-line arg...

How does a microsoft batch file work?

When you make a microsoft batch file, ie: saving @echo off :loop echo HI! goto loop as hiloop.bat, how does the code work? Originally I thought that it worked just like any other code like C++, but then I read somewhere that a batch file directly works the OS, or something like that which made it extremely efficient, so How does a m...

Read a value from a .xls file using .bat files

Hi, I just want to know if there could be any way by which we can read a value from an .xls file using a .bat file. For eg:If i have an .xls named test.xls which is having two columns namely 'EID' and then 'mail ID'.Now when we give the input to the .xls the EID name.it should extract the mail id which corresponds to the EID and ec...

How to run *.exe /key from the .bat in loop

I have directory structure: DIR |-UNINSTALL.BAT |-component_name |-source |-setup.exe |-uninst.bat |-another_component_name |-source |-setup.exe |-uninst.bat |-yet_another_component_name |-source |-setup.exe |-uninst.bat and so on... In every directory like "component_name" I have setup.exe file which installs curre...

FTP Batch file moving remote files

Hello, I have an FTP batch file that uses DOS commands to pull down some files. After I'm done pulling the files down, I would like to move the files to an archive directory on the remote server. What FTP DOS commands do I use to accomplish this? *I wasn't clear at first but this move has to take place on the remote server. ...

batch file to wait for a installation to complete before moving to the next line.

Hello, I have a batch file that will detect if the user has the .Net framework installed by going to the directory and checking if the CONFIG directory exists. If the directory doesn't exist then the user doesn't have the .Net framework installed. The batch file will contine to install the .Net framework. However, there is a problem as...

How can I change the root path in a .bat file?

Hi, In a .bat file, How can I change the root path to be c:\temp\code ...

How can I move files to the Recycle Bin in a Windows batch script or Perl?

I've got a Windows XP batch script which cleans some directories, but I would like to move the deleted files to trash instead of using plain del. How is this done? It looks like the only languages I can use for this is plain batch or Perl. ...