Your Products have been synced, click here to refresh
' ' Creates the file path (folder location) passed In via ARG1 As PATH - ( PATH String must be enclosed In " " & End With \\ ) ' iterates through String looking For \ And checks If Each folder exists ' If the folder does Not exist, it creates it before checking the Next level down Until it Gets To the End of the full path ' ' To use this script, insert a basic script command In your PC-Dmis Measurement Routine, navigate To it's location On your PC, Then enter your required path As ARG1 ' example of finished command when viewed In the PC-Dmis edit window (command mode)... ' ' location of this script On local PC ' | ' ' CS1 =SCRIPT/FILENAME= C:\USERS\Public\DOCUMENTS\SCRIPTS\MAKE_FOLDER.BAS ' Function/Main,SHOW=YES,ARG1="C:\\USERS\\PUBLIC\\DOCUMENTS\\NewFolder1\\NewFolder2\\NeFolder3\\",, ' STARTSCRIPT/ ' ENDSCRIPT/ | ' Full path of new folder (Or folders) that you want To create, enclosed In " " & ending With \\ ' ' Sub Main(PATH As String) Dim objFSO, objShell Dim objFile, objFolder As Object Dim SubPath As String Dim a,b As Integer Set objFSO = CreateObject("Scripting.FileSystemObject") a=1 b=1 Do SubPath = Left(PATH,Instr(a,PATH,"\")) b=Instr(a,PATH,"\") a=b a=a+1 If objFSO.FolderExists(SubPATH) Then 'Nothing Else Set objFile=objFSO.CreateFolder(SubPath) End If If SubPath = PATH Then Exit Do End If Loop End Sub
' ' Creates the file path (folder location) passed In via ARG1 As PATH - ( PATH String must be enclosed In " " & End With \\ ) ' iterates through String looking For \ And checks If Each folder exists ' If the folder does Not exist, it creates it before checking the Next level down Until it Gets To the End of the full path ' ' To use this script, insert a basic script command In your PC-Dmis Measurement Routine, navigate To it's location On your PC, Then enter your required path As ARG1 ' example of finished command when viewed In the PC-Dmis edit window (command mode)... ' ' location of this script On local PC ' | ' ' CS1 =SCRIPT/FILENAME= C:\USERS\Public\DOCUMENTS\SCRIPTS\MAKE_FOLDER.BAS ' Function/Main,SHOW=YES,ARG1="C:\\USERS\\PUBLIC\\DOCUMENTS\\NewFolder1\\NewFolder2\\NeFolder3\\",, ' STARTSCRIPT/ ' ENDSCRIPT/ | ' Full path of new folder (Or folders) that you want To create, enclosed In " " & ending With \\ ' ' Sub Main(PATH As String) Dim objFSO, objShell Dim objFile, objFolder As Object Dim SubPath As String Dim a,b As Integer Set objFSO = CreateObject("Scripting.FileSystemObject") a=1 b=1 Do SubPath = Left(PATH,Instr(a,PATH,"\")) b=Instr(a,PATH,"\") a=b a=a+1 If objFSO.FolderExists(SubPATH) Then 'Nothing Else Set objFile=objFSO.CreateFolder(SubPath) End If If SubPath = PATH Then Exit Do End If Loop End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |