zoukankan      html  css  js  c++  java
  • vbs,修改文件名

    一次性能测试记录,因为项目要批量上传文件,奈何文件有50 * 2个,然后系统效验文件名,要不停地修改,找了一些资料整理脚本如下:

    strFolder = "\xxxx2018198_数据文件HH"
    Dim name1,name2


    '-------------------------输入要修改的文件名--------------------------------------------
    'name1 原文件名
    'name2 要修改的文件名
    name1 ="20180919001"
    name2 ="20180920001"
    '-------------------------输入要修改的文件名--------------------------------------------


    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder(strFolder)
    Set colFiles = objFolder.Files

    For Each strFile in colFiles
    If Lcase(objFSO.GetExtensionName(strFile)) = "txt" Then
    strNewName = Replace(strFile.Name, name1, name2)
    objFSO.MoveFile strFile, strFolder & "" & strNewName
    End If
    Next

    For Each strFile in colFiles
    If Lcase(objFSO.GetExtensionName(strFile)) = "flag" Then
    strNewName = Replace(strFile.Name, name1, name2)
    objFSO.MoveFile strFile, strFolder & "" & strNewName
    End If
    Next


    'MsgBox "修改完成!"

  • 相关阅读:
    Templet
    linux command
    Codeforces Daily
    Programming Contest Challenge Book
    STL
    Struct
    Some of GDUFE
    [屯题] DP系列
    [颓废]ws_fqk省选前刷题记录
    [SDOI2009][BZOJ1876] SuperGCD|高精度|更相减损术
  • 原文地址:https://www.cnblogs.com/abcd19880817/p/9697829.html
Copyright © 2011-2022 走看看