Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
Call filecopy("\\192.168.0.102\鸣达房产软件\Realty.exe",						"D:\鸣达房产软件\Realty.exe","D:\鸣达房产软件\")
Call filecopy("\\192.168.0.102\鸣达房产软件\Dll\aicommhl.dll",				"D:\鸣达房产软件\Dll\aicommhl.dll","D:\鸣达房产软件\")
Call filecopy("\\192.168.0.102\鸣达房产软件\Dll\avicap32.dll",			"D:\鸣达房产软件\Dll\avicap32.dll","D:\鸣达房产软件\")
Call filecopy("\\192.168.0.102\鸣达房产软件\Dll\delphi.dll",			"D:\鸣达房产软件\Dll\delphi.dll","D:\鸣达房产软件\")
Call filecopy("\\192.168.0.102\鸣达房产软件\Dll\EncClient.dll",		"D:\鸣达房产软件\Dll\EncClient.dll","D:\鸣达房产软件\")
Call filecopy("\\192.168.0.102\鸣达房产软件\Dll\EncServer.dll",		"D:\鸣达房产软件\Dll\EncServer.dll","D:\鸣达房产软件\")
Call filecopy("\\192.168.0.102\鸣达房产软件\config.ini",			"D:\鸣达房产软件\config.ini","D:\鸣达房产软件\")
Call filecopy("\\192.168.0.102\鸣达房产软件\help.chm",			"D:\鸣达房产软件\help.chm","D:\鸣达房产软件\")


WSHShell.Run "Realty.exe"
FUNCTION FILECOPY(sourcefile,targetfile,targetdir)
   dim WSHSHELL,fso,f1,f2,dlm1,dlm2,msg
   set WSHShell = WScript.CreateObject("WScript.Shell")
   set fso = WScript.CreateObject("scripting.filesystemobject")
   if(fso.FileExists(sourcefile)) then
      set f1 = fso.getfile(sourcefile)
      dlm1 = f1.DateLastModified
   else
      WSHSHELL.POPUP  sourcefile & "不存在"
      WScript.Quit
   end if
   if(fso.FileExists(targetfile)) then
      set f2 = fso.getfile(targetfile)
      dlm2 = f2.DateLastModified
      if(dlm1<>dlm2) then
         fso.CopyFile sourcefile,targetdir,true
      END IF
   ELSE
      fso.CopyFile sourcefile,targetdir,true
   END IF    
END FUNCTION

FUNCTION CREATEFOLDER(foldername)
   dim WSHSHELL,fso
   set WSHShell = WScript.CreateObject("WScript.Shell")
   set fso = WScript.CreateObject("scripting.filesystemobject")
   if(Not fso.FolderExists(foldername)) then
	fso.CreateFolder(foldername) 
   end if
END FUNCTION
