BrowseFolder.vbs

Const MY_COMPUTER = &H11&
Const WINDOW_HANDLE = 0
Const OPTIONS = 0
 
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(MY_COMPUTER)
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path
 
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder (WINDOW_HANDLE, "Select a folder:", OPTIONS, strPath)
     
If objFolder Is Nothing Then
    Wscript.Quit
End If
 
Set objFolderItem = objFolder.Self
objPath = objFolderItem.Path
 
Wscript.Echo objPath
 

Usage.bat

@echo off
For /F "Tokens=1 Delims=" %%I In ('cscript //nologo BrowseFolder.vbs') Do Set _FolderName=%%I
 
.\RoboCopy\robocopy C:\TEMP %_FolderName% testfile
pause