CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 06:14:47 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=a2be6683cfb716b38ce90c4271505e63575aec2fcd9994284f5aa6e1804e1570a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22N0APSjnQU3NFAT1U7MTn6Xz-ARKTKIHx%22%3B%7D; HttpOnly; Path=/
cf-ray: 98cc381dfcb45ace-BLR
多重フォルダ解消.vbs - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- ' 多重フォルダ解消
- '
- ' 最上位フォルダから、フォルダ内がフォルダ一つでなくなるまで、階層を繰り上げる
- '
- Dim fso,argc, arg_dir,i,topfolder
- If WScript.Arguments.Count = 0 Then
- WScript.Echo("usage: this.vbs <フォルダ>" & vbCrlf _
- & " this.vbs <フォルダ> <フォルダ> <フォルダ>")
- WScript.Quit()
- End If
- Set fso = CreateObject("Scripting.FileSystemObject")
- argc = WScript.Arguments.Unnamed.Count
- For i = 0 to argc - 1
- arg_dir = WScript.Arguments.Unnamed(i)
- If fso.FolderExists(arg_dir) <> false Then
- If ( IsDriveLetter(arg_dir) ) Then
- WScript.Echo("ドライブ名は指定できません: """ & arg_dir & """")
- Else
- topfolder = GetTopFolder(arg_dir)
- If (0 <> StrComp(arg_dir, topfolder, vbTextCompare)) Then
- Dim tmp, f, deldir
- Dim post_dir
- Set post_dir = Nothing
- Set f = fso.GetFolder(topfolder)
- For Each tmp In fso.GetFolder(arg_dir).SubFolders
- Set deldir = tmp
- Next
- For Each tmp in f.SubFolders
- If (fso.FolderExists( arg_dir & "\" & tmp.Name)) Then
- tmp.Name = "_" & tmp.Name
- fso.MoveFolder tmp.path, arg_dir & "\"
- Set post_dir = fso.GetFolder(arg_dir & "\" & tmp.Name)
- Else
- fso.MoveFolder tmp.path, arg_dir & "\"
- End If
- Next
- For Each tmp in f.Files
- fso.MoveFile tmp.path, arg_dir & "\"
- Next
- If fso.FolderExists(deldir.Path) Then
- fso.DeleteFolder deldir.Path, true
- End If
- If Not (post_dir Is Nothing) Then
- post_dir.Name = Mid(post_dir.Name, 2)
- End If
- Set deldir = Nothing
- Set f = Nothing
- Set tmp = Nothing
- Set post_dir = Nothing
- End If
- End If
- End If
- Next
- Set fso = Nothing
- Function IsAlpha(c)
- Dim x
- x = Asc(c)
- IsAlpha = CBool( (65<=x And x<=90) Or (97<=x And x<=122) )
- End Function
- Function IsDriveLetter(p)
- If ( ((3=Len(p)) And (":\"=Right(p,2)) And IsAlpha(Left(p,1))) _
- Or ((2=Len(p)) And (":"=Right(p,1)) And IsAlpha(Left(p,1))) ) Then
- IsDriveLetter = true
- Else
- IsDriveLetter = false
- End If
- End Function
- Function GetTopFolder(d)
- Dim tmp, f, dirs
- Set f = fso.GetFolder(d)
- Set dirs = f.SubFolders
- If (f.Files.Count = 0 And dirs.Count = 1) Then
- For Each tmp In dirs
- GetTopFolder = GetTopFolder(tmp.Path)
- Next
- Else
- GetTopFolder = d
- End If
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐✅ Trading Profit Method ✅ NEVER SEEN BEFORE...
JavaScript | 1 sec ago | 0.24 KB
-
⭐ Instant BTC Profit Method ✅ NEVER SEEN BEFO...
JavaScript | 10 sec ago | 0.24 KB
-
⭐✅ MAKE $2000 INSTANTLY ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 20 sec ago | 0.24 KB
-
⭐ Free Crypto Method ✅ NEVER SEEN BEFORE ⭐⭐⭐
JavaScript | 31 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ✅ NEVER SEEN...
JavaScript | 42 sec ago | 0.24 KB
-
⭐✅ Marketplace Glitch ✅ Working ✅ NEVER SEEN...
JavaScript | 51 sec ago | 0.24 KB
-
✅⭐ Make $2500 in 15 minutes ✅ NEVER SEEN BEFO...
JavaScript | 1 min ago | 0.24 KB
-
⭐ Instant BTC Profit Method ✅ NEVER SEEN BEFO...
JavaScript | 1 min ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand