[in .vbs][3in1] 创建多个文件夹 180 =>在所有 180 个中创建子文件夹 =>在创建的子文件夹中移动文件并重命名文件 [3in1] “x, y, z" [英] [in .vbs][3in1] Create multiple folder 180 => Create subfolders in All 180 => Move file and rename file in Subfolders created [3in1] "x, y, z"

查看:32
本文介绍了[in .vbs][3in1] 创建多个文件夹 180 =>在所有 180 个中创建子文件夹 =>在创建的子文件夹中移动文件并重命名文件 [3in1] “x, y, z"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

"x, y, z"(垂直、水平、移动和重命名文件.)我想结合 3in1 (x,y,z.).vbs

"x, y, z" (vertical, horizontal, Move and rename files.) i want to combine 3in1 (x,y,z.).vbs

在 .vbs [摘要]

in .vbs [summary]

先在这里阅读

"x" 尝试创建多个文件夹使用 VBScript

Option Explicit
Dim objFSO, objFolder, strDirectory, i
strDirectory = "C:\New folder (2)\"

Set objFSO = CreateObject("Scripting.FileSystemObject")
i = 0
While i < 180
Set objFolder = objFSO.CreateFolder(strDirectory & i)
i = i+1
WScript.Quit
Wend

"y" 帮助使用 VBScript 在 Windows 中创建 Folder1/Folder2(这两个文件夹以前都不存在,我的意思是创建多级文件夹@a strech.)

Set objShell = CreateObject("Wscript.Shell")
objShell.Run "cmd /c mkdir C:\folder1\folder2\folder3"

Set fs = CreateObject("Scripting.FileSystemObject")
fs.CreateFolder("C:\New folder\Client")
fs.CreateFolder("C:\New folder\Client\subclient")
fs.CreateFolder("C:\New folder\Client\subclient\subsubclient")

"z"

Set x = CreateObject("Scripting.FileSystemObject")
x.MoveFile "C:\myfile.txt" , "C:\New folder\myfile222.txt"

<小时>

我想要制作


i want make

我希望你能理解我对x、y、z"(垂直、水平、移动和重命名文件)的理解.

I hope you understand where I'm going with "x, y, z" (vertical, horizontal, Move and rename files.)

"x" 创建多个文件夹(i = 0 | i <180 个文件夹)

"x" Create multiple folders (i = 0 | i < 180 folders)

y"子文件夹(在所有x"180个文件夹中)

"y" subfolders (in All "x" 180 folders)

z"和移动文件并在新位置重命名

"z" and Move file and rename in new location

myFSO.MoveFile "C:\myfile1.txt" , "C:\New folder\myfile222.txt"

myFSO.MoveFile "C:\myfile1.txt" , "C:\New folder\myfile222.txt"

180 个发送到每个 180 个x,y"...子文件夹

for 180 send to each 180 "x,y"...subfolders

1) 像脚本一样创建多个文件夹,最多 0-180 个文件夹

1) Create multiple folder like script up 0-180 folders

2) 在创建的所有 180 个文件夹中创建子文件夹.

2) Create subfolders in All 180 Folders created.

3) 移动文件 (C:\Name.txt) 并重命名子文件夹中的文件 (C:\New folder\FolderB\Folder1\FolderQ\folder3\folderG\myfile222.txt)

3) Move file (C:\Name.txt) and rename file in subfolder (C:\New folder\FolderB\Folder1\FolderQ\folder3\folderG\myfile222.txt)

C:\New folder\FolderB\Folder1\FolderQ\folder3\folderG

C:\New folder\FolderB\Folder1\FolderQ\folder3\folderG

我想将所有内容合并为一个脚本.

I want to combine all in one script.

我需要[创建多个文件夹] [并且每个文件夹创建 180] = >> [我想创建子文件夹] [并移动文件 (name.txt) 并在子文件夹中重命名]

I need [create multiple folder] [and every folder created 180] = >> [I want to create subfolders] [And move file (name.txt) and rename in subfolder]

例如:文件夹 i <180 , 在每个文件夹 1-180 创建我想创建子文件夹, 在所有 180 文件夹中

ex: folder i < 180 , in every folder 1-180 created I want to create subfolders, in all 180 folders

"x" 创建多个文件夹,如 (i = 0 | i <180 个文件夹)

"x" Create multiple folders like (i = 0 | i < 180 folders)

"y" 子文件夹如

"C:\新文件夹\FolderB\Folder1\FolderQ\folder3\folderG

"C:\New folder\FolderB\Folder1\FolderQ\folder3\folderG

"z" 在子文件夹中移动文件和重命名文件,例如

"z" Move file and Rename file in Subfolders like

myFSO.MoveFile "C:\myfile1.txt" , "C:\New folder\myfile222.txt"

myFSO.MoveFile "C:\myfile1.txt" , "C:\New folder\myfile222.txt"

myFSO.MoveFile "C:\myfile1.txt" , "C:\New folder\FolderB\Folder1\FolderQ\folder3\folderG\myfile222.txt"

myFSO.MoveFile "C:\myfile1.txt" , "C:\New folder\FolderB\Folder1\FolderQ\folder3\folderG\myfile222.txt"

我想合并多个文件夹和每个文件夹中的子文件夹180,并移动文件(Name.txt)并重命名子文件夹(FolderG)中的文件

I want to combine multiple folders with subfolders in each folder 180, And move file (Name.txt) and rename file in subfolder (FolderG)

谢谢你的帮助.请原谅我在谷歌翻译中翻译的英语我希望您能理解我要使用x、y、z"(垂直、水平、文件)的含义.

Thank you for you help. Please excuse my English I have translated in Google Translate I hope you understand where I'm going with "x, y, z" (vertical, horizontal, files.)

推荐答案

Dim i

With CreateObject("Scripting.FileSystemObject")
    For i = 0 to 179
        SmartCreateFolder "C:\Test\MySet\Folder" & i
        .CopyFile "C:\Test\data.txt", "C:\Test\MySet\Folder" & i & "\file_" & Left(CreateObject("Scriptlet.TypeLib").GUID, 38) & ".txt", True
    Next
    .DeleteFile "C:\Test\data.txt", True
End With

Sub SmartCreateFolder(strFolder)
    ' http://www.visualbasicscript.com/tm.aspx?m=29290
    With CreateObject("Scripting.FileSystemObject")
        If Not .FolderExists(strFolder) then
            SmartCreateFolder(.getparentfoldername(strFolder))
            .CreateFolder(strFolder)
        End If
    End With 
End Sub

感谢 SmartCreateFolder 2 @EBGreen

Thanks for SmartCreateFolder 2 @EBGreen

这篇关于[in .vbs][3in1] 创建多个文件夹 180 =>在所有 180 个中创建子文件夹 =>在创建的子文件夹中移动文件并重命名文件 [3in1] “x, y, z"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆