refresh group cmd

来源:互联网 发布:ios webview js 交互 编辑:程序博客网 时间:2024/05/18 03:04

@echo off

 rem ## STEP 1: Remote machine ##
 rem *tarSvr      target remote server name or IP address (i.e. \\hk000tko6671.hk.hsbc\  or \\133.13.156.66\)
 rem *tarUser     remote server logon user name
 rem *tarPwd      remote server logon pass word
 rem *fromDisk    source disk path(get From where)
 rem *toDisk      target disk path(copy To where)
 rem *tarCmd      target full command for NET USE running (net use l: \\hk000tko6671.hk.hsbc\d$ * /USER:hk000tko6671\appsadmin  直接登陆后映射对方C:到本地为H:)
 
 SET tarSvr=\\IP\
 SET tarUser=appadmin
 SET tarPwd=hsbc@1234
 SET fromDisk=x:
 SET toDisk=y:
 SET tarCmd=net use %toDisk% %tarSvr%%fromDisk% * /USER:%tarUser%\%tarPwd%
 
 net use %tarCmd%
 
 
 
 
 rem ## STEP 2: Copy file ##
 rem *copy 命令       替换文件需要添加 /y 参数才能直接替换.不然会出现提示是否替换.
 rem *sample          copy /y C:\复制\1.TXT C:\原文件\1.TXT
 
 SET sourceFile=A:\复制\1.TXT
 SET targetFile=B:\原文件\1.TXT
 
 
 IF EXIST %targetFile% del %targetFile%
 IF EXIST %sourceFile% copy /y %sourceFile% %targetFile%
 
 
 
 
 rem ## STEP 3: Run refresh command ##
 rem *refGrpCmd     你需要执行的更新策略组命令
 SET refGrpCmd=
 
 IF EXIST %targetFile% (
  %refGrpCmd%
  echo Done
  pause
  ) ELSE ( exit )
 


0 0
原创粉丝点击