@echo off
for /f "tokens=2*" %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Tencent Traveler" /v DisplayIcon^|findstr "DisplayIcon"') do set "tt=%%j" if not defined tt goto ie
start "" "%tt%" www.baidu.com
start "" "%tt%" http://www.cn-dos.net/forum/
: ie
start iexplore http://www.baidu.com/
start iexplore http://www.cn-dos.net/forum/
exit
能不能把下面的代码再简化下,如过有6个网站或者更多,怎么搞
这个是我每天要用的,只好麻烦大家下了,帮我简化下,重复的代码太多,谢谢
@cho off
set "baidu=www.baidu.com"
set "cn-dos=http://www.cn-dos.net/forum/"
for /f "tokens=2*" %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Tencent Traveler" /v DisplayIcon^|findstr "DisplayIcon"') do set "tt=%%j"
if not defined tt goto ie
start "" "%tt%" %baidu%
start "" "%tt%" %cn-dos%
: ie
start iexplore %baidu%
start iexplore %cn-dos%
exit
@echo off
set "baidu=www.baidu.com"
set "cn-dos=http://www.cn-dos.net/forum/"
for /f "tokens=2*" %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Tencent Traveler" /v DisplayIcon^|findstr "DisplayIcon"') do set "tt=%%j"
if not defined tt goto :ie
for %%a in (%baidu% %cn-dos%) do (
start "" "%tt%" %%a
)
:ie
for %%a in (%baidu% %cn-dos%) do (
start iexplore %%a
)
@echo off
set "URL_baidu=www.baidu.com"
set "URL_cn-dos=http://www.cn-dos.net/forum/"
for /f "tokens=2*" %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Tencent Traveler" /v DisplayIcon ^|findstr "DisplayIcon"') do set "tt=%%j"
if not defined tt goto :ie
for /f "tokens=1* delims==" %%i in ('set URL_') do (
start "" "%tt%" %%j
)
exit
:ie
for /f "tokens=1* delims==" %%i in ('set URL_') do (
start iexplore %%j
)
[ Last edited by balinger on 2008-6-30 at 04:15 PM ]