Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to update a file then run batch job ?

Status
Not open for further replies.

bolobaboo

MIS
Aug 4, 2008
120
US
Hi
I am newbee when comes scripting in VB. I have a file which needs to be updated with folder name using wordpad each time before a batch file is run.
Folder names are provided in text file.

file to be updated ( test.osj)
=============================
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<ICArchiver job="test">
<vendor>IBM</vendor>
<version>5.5.1.0</version>
<creation date="2008-07-29" time="14:57:34" user="nm31453adm"/>
<last-modification date="2008-07-31" time="15:36:43" user="nm31453adm"/>
<archive type="Tivoli Storage Manager">
<host>cbdstsm1.pharma.aventis.com</host>
<port></port>
<name>SA-HSM1</name>
<user></user>
<passwd></passwd>
</archive>
<source-files backup-before-migrate="true">
<directory action="replace" location="\\CBDSAPPOSM01\E$\Tivoli\20080721" recurse="true"/>
<include age="0.01:00:00" type="creation-older-than"></include>
</directory>
</source-files>
</ICArchiver>

text file which has folder names
================================
20061221
20061222
20070109
20070110
20070111
20070112

batch file to be run
===================
"C:\Program Files\Tivoli\TSM\hsmclient\dsmclc.exe" "C:\Program Files\Tivoli\TSM\hsmclient\jobs\test.osj" >> "D:\hsm_logs\hsm_sched.log"

I needs to update following line
<directory action="replace" location="\\CBDSAPPOSM01\E$\Tivoli\20080721" recurse="true"/>

with folder names from list then run batch file once done then go back and update with next folder name and run same batch file again till all folders ran.
I would appreciate if any body can help on this.
Thank you.

 
What have you tried so far and where in your code are you stuck ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi
PHV
I can write batch file but dumb when comes writing VB script. Some body said above only can be done by VB script.Don't know how to open osj file in wordpad then update with folder name.
Help very much apprerciated.
THX
 
The xml file is no good, why bother?
 
I believe he means that this is bad:

<directory action="replace" location="\\CBDSAPPOSM01\E$\Tivoli\20080721" recurse="true"/>
<include age="0.01:00:00" type="creation-older-than"></include>
</directory>

I.e. the original directory tag is closed, then later there is a close-tag for directory.

I seem to be seeing a lot of messed up XML like this lately.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top