1
Programs / Selecting a folder (a little vbs function)
« on: April 10, 2022, 10:54:15 am »
Little function to select a folder with VBS
(win systems)
(win systems)
Code: QB64: [Select]
- fs1$ = "Dim objFolder, objItem, objShell" + FS2$
- fs1$ = fs1$ + "On Error Resume Next" + FS2$
- fs1$ = fs1$ + "SelectFolder = vbNull" + FS2$
- fs1$ = fs1$ + "myStartFolder = " + "²" + Repz$ + "²" + FS2$
- fs1$ = fs1$ + "Set objShell = CreateObject( ²Shell.Application² )" + FS2$
- fs1$ = fs1$ + "Set objFolder = objShell.BrowseForFolder( 0, ²Select Folder², 0, myStartFolder )" + FS2$
- fs1$ = fs1$ + "If IsObject( objfolder ) Then SelectFolder = objFolder.Self.Path" + FS2$
- fs1$ = fs1$ + "Set WshShell = WScript.CreateObject(²WScript.Shell²)" + FS2$
- fs1$ = fs1$ + "WshShell.Run ²cmd.exe /c echo ² & SelectFolder & ² | clip², 0, TRUE " + FS2$
- REPSELECTOR$ = _Clipboard$