Hi

I am trying to write a Windows 2003 Server logon script to compair two files
("file1" and "file2"), if the files are different (say in size) then I need
to replace "file2" with "file1".

The algorithm is:
if file1 "is different" from file2 then
Overwrite file2 with file1 (a simple "copy file1 file2" will
suffice)

Is there a simple way to do it using a script (VBScript) so I can run it
when the user logs on?
My VBScript knowledge is NIL, I have no problems compiling a Visual Basic
program to perform the task, but would like to see how it can be done using
a script.

Any help would be appreaciated.

Regards
Gitendra

Re: Script to compair two files Help? by jg

jg
Sat Feb 18 09:08:12 CST 2006

you don't need vbscript esp. if you are not familar with vbscript
use bat file. try this in say login.bat:
fc file1 file2
if ERRORLEVEL 1 copy file1 file2

Note: the above has not been tested.

"Gitendra Proctor" <c2g@bordernet.com.au> wrote in message
news:43f7229d$0$17122$5a62ac22@per-qv1-newsreader-01.iinet.net.au...
> Hi
>
> I am trying to write a Windows 2003 Server logon script to compair two
> files ("file1" and "file2"), if the files are different (say in size) then
> I need to replace "file2" with "file1".
>
> The algorithm is:
> if file1 "is different" from file2 then
> Overwrite file2 with file1 (a simple "copy file1 file2" will
> suffice)
>
> Is there a simple way to do it using a script (VBScript) so I can run it
> when the user logs on?
> My VBScript knowledge is NIL, I have no problems compiling a Visual Basic
> program to perform the task, but would like to see how it can be done
> using a script.
>
> Any help would be appreaciated.
>
> Regards
> Gitendra
>



Re: Script to compair two files Help? by Al

Al
Sat Feb 18 18:17:28 CST 2006


"jg" <junk@mail.pls> wrote in message
news:OwBbR1JNGHA.3196@TK2MSFTNGP09.phx.gbl...
> you don't need vbscript esp. if you are not familar with vbscript
> use bat file. try this in say login.bat:
> fc file1 file2
> if ERRORLEVEL 1 copy file1 file2
>
> Note: the above has not been tested.

I expect it would work, assuming both names given were of files. But if
file1 were a file and file2 were a folder, the errorlevel would be 2, and
the copy command would copy file1 into the folder called file2.

/Al


> "Gitendra Proctor" <c2g@bordernet.com.au> wrote in message
> news:43f7229d$0$17122$5a62ac22@per-qv1-newsreader-01.iinet.net.au...
> > Hi
> >
> > I am trying to write a Windows 2003 Server logon script to compair two
> > files ("file1" and "file2"), if the files are different (say in size)
then
> > I need to replace "file2" with "file1".
> >
> > The algorithm is:
> > if file1 "is different" from file2 then
> > Overwrite file2 with file1 (a simple "copy file1 file2" will
> > suffice)
> >
> > Is there a simple way to do it using a script (VBScript) so I can run it
> > when the user logs on?
> > My VBScript knowledge is NIL, I have no problems compiling a Visual
Basic
> > program to perform the task, but would like to see how it can be done
> > using a script.
> >
> > Any help would be appreaciated.
> >
> > Regards
> > Gitendra
> >
>
>