⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 createpath.vbs

📁 Apress - Managing Enterprise Systems With The Windows Script Host Source Code
💻 VBS
字号:
Sub CreatePath(strPath)
 Dim nSlashpos, objFSO
 Set objFSO = CreateObject("Scripting.FileSystemObject")

 ' strip any trailing backslash
  If Right(strPath, 1) = "\" Then 
   strPath = Left(strPath, Len(strPath) - 1) 
  End If
   
   'if path already exists, exit
   If objFSO.FolderExists(strPath) Then Exit Sub 
    'get position of last backslash in path
    nSlashpos = InStrRev(strPath, "\")
     If nSlashpos <> 0 Then
             If Not objFSO.FolderExists(Left(strPath, nSlashpos)) Then
                    CreatePath Left(strPath, nSlashpos - 1) 
     End If
   End If

  objFSO.CreateFolder strPath
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -