我想知道是否有人可以帮助我修改当前代码,以包含一个弹出对话框,要求用户指定将%name%.dsd文件放在何处。我还希望将其存储在%location%之类的变量中,以便能够替换使用%cd%的当前方法。代码如下:
@echo off
echo.
echo Hello!
echo Got file?
color f9
set /p="What did you name your file?:"<nul
set /p name=
cd %localhost%
echo -publish> %name%%.scr
echo %cd%\%name%%.dsd>> %name%%.scr
@echo off
echo Set oWS = WScript.CreateObject("WScript.Shell") > CreateShortcut.vbs
echo sLinkFile = "%cd%\%name%%.lnk" >> CreateShortcut.vbs
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> CreateShortcut.vbs
echo oLink.TargetPath = "C:\Program Files\Autodesk\AutoCAD 2017\accoreconsole.exe" >> CreateShortcut.vbs
echo oLink.arguments = "/s %cd%\%name%%.scr" >> CreateShortcut.vbs
echo oLink.Save >> CreateShortcut.vbs
cscript CreateShortcut.vbs
del Createshortcut.vbs
cls
echo .
echo .
echo .
echo .
echo .
echo .
echo .
echo .
echo . Done, bye!
echo .
pause
答案 0 :(得分:1)
您可以从批处理文件中直接调用Powershell real,以创建一个对话框来让用户选择文件夹。
/********************************************************
//AUTOPLAY IFRAME
- Autoplay video when iFrame is in view, pause when not
********************************************************/
play_i = 0;
jQuery(window).scroll(function() {
jQuery("iframe").each( function() {
$this = jQuery(this);
_src = $this.attr('src');
_ID = $this.attr('id');
_yPos = jQuery(window).scrollTop();
_thisHT = $this.height();
_thisTop = $this.offset().top;
_thisBottom = _thisTop + _thisHT;
if( _yPos > _thisTop*0.5 && _yPos < _thisBottom && play_i < 1) { //if iframe is in view
$this[0].contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*'); //play video
play_i++;
} else {
$this[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); //pause video
}
});
});