![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-05 10:23 |
48,038 topics / 350,123 posts / today 1 new / 48,251 members |
| DOS批处理 & 脚本技术(批处理室) » Help convert exe to bat |
| Printable Version 1,445 / 2 |
| Floor1 bbq123bbq | Posted 2007-07-15 00:08 |
| 初级用户 Posts 77 Credits 197 | |
|
http://zhenlove.com.cn/cndos/fileup/files/Batch MP3 Download.rar
Generally, what method is used to convert an EXE to a BAT? |
|
| Floor2 aijiushiai | Posted 2007-07-15 03:09 |
| 初级用户 Posts 24 Credits 64 | |
|
@echo off
setlocal enabledelayedexpansion set read=☆☆☆☆ 欢 迎 访 问 GHOST 工 作 室 QQ:81465430 ☆☆☆☆ color 4f for /l %%i in (1,1,100) do ( cls echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo !read:~0,%%i! ping/n 1 127.1>nul 2>nul ) echo.&echo.&echo. echo === === === === 按任意键开始主程序! cls title 歌曲批量下载\试听 ** 歌词批量下载 GHOST工作室批量MP3下载 - * ::~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :: Variable configuration:::::::::::::::::::::::::::::: :: Set the song format %x% as follows, only one type can be set :: 0 mp3;1 rm;2 wma;3 asf;4 ram;5 mid;6 flash;7 mpg;8 avi;9 mpeg;10 rmvb;11 ra set "x=0" :: Get the number of download addresses %down_n%, so that when the first download address fails, you can still download from other addresses set "down_n=2" :: Download song lyrics at the same time 0; only download lyrics 1 set "q+c=0" :: Song preview 0; song not preview 1 (when encountering preview + download, preview first and then start downloading) set "t=1" ::~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cls if %t%*==0* if not exist mplayer.exe ( echo Missing file mplayer.exe echo Please go to http://www1.mplayerhq.hu/MPlayer/releases/win32/MPlayer-mingw32-1.0pre8.zip echo or http://yx127.com/mplayer.exe to download, size 7.65M pause>nul&goto :eof) ::~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cls :: Set file association Assoc .lrc=lrc Ftype lrc=C:\WINDOWS\system32\notepad.exe %1 :: Test configuration:::::::::::::::::::::::::::::: echo %~p0|find /i "Rar$">nul &&(echo Please extract this program to a folder to use&pause>nul&goto :eof) if not exist wget.exe (echo Missing file wget.exe&pause>nul&goto :eof) if not exist sed.exe (echo Missing file sed.exe&pause>nul&goto :eof) if not exist music.txt ( echo Missing file music.txt, please write manually echo. echo -----music.txt format is as follows------------------- echo Don't hurt me anymore echo Have to love echo ...... echo ----------------------------------------- pause>nul&goto :eof ) echo %x%|findstr "">nul||call :xxxx if not %x%==0 if %x:~0,1%==0 call :xxxx if 11 lss %x% call :xxxx echo %q+c%|findstr "">nul||call :xxxx if not %q+c%==0 if %q+c:~0,1%==0 call :xxxx if 1 lss %q+c% call :xxxx echo %t%|findstr "">nul||call :xxxx if not %t%==0 if %t:~0,1%==0 call :xxxx if 1 lss %t% call :xxxx ping -n 1 mp3.baidu.com>nul||(echo Please check the network first, can't ping http://mp3.baidu.com&pause>nul&goto :eof) findstr . music.txt>nul||(echo There is no song name in music.txt&pause>nul&goto :eof) :: Automatically set song format %n_% according to %x% :: 0 mp3;1 rm;2 wma;3 asf;4 ram;5 mid;6 flash;7 mpg;8 avi;9 mpeg;10 rmvb;11 ra if %x%==0 set x_=mp3 if %x%==1 set x_=rm if %x%==2 set x_=wma if %x%==3 set x_=asf if %x%==4 set x_=ram if %x%==5 set x_=mid if %x%==6 set x_=flash if %x%==7 set x_=mpg if %x%==8 set x_=avi if %x%==9 set x_=mpeg if %x%==10 set x_=rmvb if %x%==11 set x_=ra goto test_ok :xxxx echo Variable configuration error&pause>nul&goto :eof ::~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :test_ok cd.>xxxx.txt :: Start downloading:::::::::::::::::::::::::::::: cls echo ---------------------------------------------------------- echo Press any key to start downloading the following songs, continue to add please open music.txt to add echo ---------------------------------------------------------- more<music.txt echo ---------------------------------------------------------- for /f "tokens=*" %%? in ('sed "s/ //g" music.txt') do call :start "%%?" del /q/f temp_.txt&del /q/f index.txt cls findstr . xxxx.txt>nul||(del /q/f xxxx.txt&echo GHOST Studio reminds: All songs are downloaded, press any key to return&pause>nul&goto :eof) echo The following songs were not downloaded&type xxxx.txt&del /q/f xxxx.txt&pause>nul&goto :eof :start cls set "p1=http://mp3.baidu.com/m?f=ms^&tn=baidump3^&ct=134217728^&lf=^&rn=^&word=" set "p2=^&lm=" set "n=%~1" :: url_a is the page directly searching for the song on Baidu set "url_a=%p1%%n%%p2%%x%" call :wget.bat "%url_a%" index.txt find "抱歉,没有找到与" index.txt>nul &&(echo Sorry, no MP3 content related to "%n%" was found&>>xxxx.txt echo %n%&ping -n 1 127.1>nul&goto :eof) :Download lyrics if not exist %n%.lrc ( for /f "tokens=2 delims=★" %%? in ('sed -n "/<td width=10px valign=top>1<\/td>/{n;n;n;n;n;n;n;p;}" index.txt ^|sed "s/\x22/★/g"') do (call :wget.bat "%%?" temp_.txt) sed -n "/<div class=\x22pad10L\x22>/{n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;p;}" temp_.txt |sed "s/<font style=color:#e10900>//g" |sed "s/<\/font>//g" |sed "s/<br>/,/g">>%n%.lrc echo The lyrics of song %n%.%x_% have been downloaded successfully ) else (echo The lyrics of song %n%.%x_% already exist) ping -n 1 127.1>nul if "%q+c%"=="1" (if "%t%"=="1" goto end_2) :Download song :: url_b? is the page with the song download address for /l %%~ in (1,1,%down_n%) do ( if exist %n%.%x_% goto end_2 for /f "tokens=2 delims=★" %%? in ('sed -n "/<td width=10px valign=top>%%~<\/td>/{n;n;p;}" index.txt ^|sed "s/\x22/★/g"') do ( set "url_b%%~=%%?" call :wget.bat "%%?" temp_.txt ) for /f "tokens=6 delims=★" %%! in ('sed -n "/请点击此链接/{n;p;}" temp_.txt ^|sed "s/\x22/★/g"') do ( if %t%*==0* call :mplayer.bat "%%!" if %q+c%*==1* goto end_2 echo Downloading song %n%.%x_%...... :: Try 3 times repeatedly, do not download quietly (display download progress, add -q parameter if you want to download quietly) wget --output-document=%n%.%x_% --tries=3 "%%!" echo Song %n%.%x_% has been downloaded successfully ) ) :end_2 ping -n 1 127.1>nul goto :eof ::~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ::call *.bat:::::::::::::::::::::::::::::: :wget.bat cd.>%2 wget --output-document=%2 -q "%~1" goto :eof :mplayer.bat cls title mplayer→→%~1 echo. echo ------Playback control----------------------------------------------------------------- echo ← or → Rewind or fast forward 10 seconds echo ↑ or ↓ Rewind or fast forward 1 minute echo pgdown or pgup Rewind or fast forward 10 minutes echo p or space Pause/play (pause movie^) echo q or ESC or Enter End/next song (stop playing and quit program^) echo 9 or 0 Increase/decrease volume echo Increase/decrease playback speed echo -------------------------------------------------------------------------------- echo. echo ------Lyrics---------------------------------------------------------------------- type %n%.lrc echo -------------------------------------------------------------------------------- mplayer "%~1">nul goto :eof |
|
| Floor3 AlexZhang | Posted 2007-07-25 18:27 |
| 系统支持 Posts 435 Credits 1,011 | |
|
I don't know but as far as I know, changing the bat extension to exe or com can also be executed
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |