Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Update bat file contents  (Read 2322 times)

0 Members and 1 Guest are viewing this topic.

Brockmoore

  • Guest
Update bat file contents
« on: May 04, 2007, 10:25:11 AM »
I search and found many close examples, so posting this request, easy for some people here Im sure.  :)

We have a group of files, mostly .bat files that have passwords in them (yes, I know) and every month the passwords need to be updated.

I would like a batch file that takes the new password as a parameter then updates the old one in all the files.

I have this working for most files, but some of our .bat files have special characters in them which are not getting put into the new file.

Example .bat file:

set server=value
set user=value
set password=value
set db=value

pushd %~dp0

CALL "SQLCMD.EXE" -S %server% -U %user% -P %password% -d %db% -Q "%db%.dbo.reSETpartition"

popd