本帖最后由 pcl_test 于 2016-1-14 19:05 编辑
注:请在支持wmic环境下运行,版本6.1以上,缺点需要复制文件会产生临时快捷方式,如果有类似文档,请管理合并
- @echo off
- for /f "delims=" %%i in ('dir/a-d/s/b/l/on ".\*.lnk"')do (
- xcopy/y "%%i" "%programdata%\microsoft\windows\start menu\programs\startup\" >nul 2>nul
- for /f "delims=" %%j in ('wmic startup where description^="%%~ni" get * /value')do (
- for /f "tokens=1,* delims==" %%k in ("%%j")do (
- if /i "%%k"=="command" (
- echo,lnkname: %%~nxi
- echo,lnkpath: %%l
- )
- )
- )
- del/f/q "%programdata%\Microsoft\Windows\Start Menu\Programs\Startup\%%~nxi" >nul 2>nul
- )
- pause
复制代码
|