hi dostips batch scripters,
do anyone know how to insert the text string from another file ex. ref.txt?
for example,
ref.txt
-----------content--------------
"c:\reports\source\"
----------end content-----------
copy.bat
------------code start-----------
@echo off
CD " ref.txt " <- get the upper 'text string' from ref.txt & insert it here!!
copy *.doc "d:\destination\"
-----------code end-------------
so that whenever i change the location of the source in ref.txt,
the copy.bat still works as my new location!!
thanks !!
get text string from a ref.txt
Moderator: DosItHelp
Re: get text string from a ref.txt
Code: Select all
@echo off
for /f "usebackq delims=" %%a in ("ref.txt") do cd /d "%%a"
copy *.doc "d:\destination"
Re: get text string from a ref.txt
hey
thanks!!! this script works just fine...!!!
thanks!!! this script works just fine...!!!