运行此批处理文件 - 它允许您选择一个文件夹,然后在变量中返回文件夹路径。
@if (@CodeSection == @Batch) @then
@echo off
echo Select a folder:
pause
for /F "delims=" %%a in ('CScript //nologo //E:JScript "%~F0"') do (
set Destination_Folder=%%a
)
echo "%Destination_Folder%"
pause>nul
:EXIT
exit
@end
// Creates a dialog box that enables the user to select a folder and display it.
var title = "Select a folder", rootFolder = 0;
var shl = new ActiveXObject("Shell.Application");
var folder = shl.BrowseForFolder(0, title, 0, rootFolder);
WScript.Stdout.WriteLine(folder ? folder.self.path : "");