且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

根据文件顺序创建快捷方式

更新时间:2023-01-31 11:28:38

好吧,经过大量搜索,我设法...

Well, after much searching I managed to ...

要使用它,需要以下程序:

To use it will be necessary the following programs:

https://helgeklein.com/downloads/DesktopRefresh/current/x86/DesktopRefresh.zip http://optimumx.com/download/Shortcut.zip

@echo off

If exist "Arquivos\Config.ini" For /f "usebackq delims=" %%x in ("Arquivos\Config.ini") do (set "%%x")

If not Exist "Arquivos\Config.ini" Set /p Localizacao="Enter the file location: " & Set Numeracao=1
Dir /b "%Localizacao%" >"Arquivos\Arquivos.ini"
Echo Fim.Final >>"Arquivos\Arquivos.ini"

:Atalhos

If Exist "C:\Users\%username%\Desktop\%ep2%.lnk" Del /q "C:\Users\%username%\Desktop\%ep2%.lnk">nul 2>&1 & Start /Min /Wait Arquivos\DesktopRefresh.exe>nul 2>&1

setlocal EnableDelayedExpansion
set "cmd=findstr /R /N "^^" Arquivos\Arquivos.ini | find /C ":""

for /f %%a in ('!cmd!') do set numeros=%%a

set linhas=%Numeracao%
set curr=1
for /f "delims=" %%a in ('type Arquivos\Arquivos.ini') do (
    for %%b in (!linhas!) do (
        if !curr!==%%b Set Ep1=%%a
    )
    set /a "curr = curr + 1"
)

Set Ep2=%Ep1%
set "find=*."
call set delete=%%Ep2:!find!=%%
call set Ep2=%%Ep2:!delete!=%%
Set Ep2=%Ep2:.=%

IF "%Ep2%"=="Fim" Goto Fim

Arquivos\Shortcut.exe /F:"C:\Users\%username%\Desktop\%ep2%.lnk" /A:C /t:"%Localizacao%\%Ep1%">nul 2>&1
Set /A Numeracao = %linhas% + 1

Set Localizacao > Arquivos\Config.ini
Set Ep2 >> Arquivos\Config.ini
Set Numeracao >> Arquivos\Config.ini
exit

:Fim

Set Numeracao=1

If Exist "C:\Users\%username%\Desktop\%ep2%.lnk" Del /q "C:\Users\%username%\Desktop\%ep2%.lnk">nul 2>&1 & Start /Min /Wait Arquivos\DesktopRefresh.exe>nul 2>&1

setlocal EnableDelayedExpansion
set "cmd=findstr /R /N "^^" Arquivos\Arquivos.ini | find /C ":""

for /f %%a in ('!cmd!') do set numeros=%%a

set linhas=1
set curr=1
for /f "delims=" %%a in ('type Arquivos\Arquivos.ini') do (
    for %%b in (!linhas!) do (
        if !curr!==%%b Set Ep1=%%a
    )
    set /a "curr = curr + 1"
)

Set Ep2=%Ep1%
set "find=*."
call set delete=%%Ep2:!find!=%%
call set Ep2=%%Ep2:!delete!=%%
Set Ep2=%Ep2:.=%

Arquivos\Shortcut.exe /F:"C:\Users\%username%\Desktop\%ep2%.lnk" /A:C /t:"%Localizacao%\%Ep1%">nul 2>&1
Set /A Numeracao = 1 + 1

Set Localizacao > Arquivos\Config.ini
Set Ep2 >> Arquivos\Config.ini
Set Numeracao >> Arquivos\Config.ini
Exit

  • 将脚本放置在文件夹中,将程序放置在名为"Arquivos"的文件夹中
  • 订单将保持原状
  • Script.bat
  • 文件夹-Arquivos
  • 在文件夹中:DesktopRefresh.exe和Shortcut.exe
    • Place the script in a folder and programs in a folder called "Arquivos"
    • The Order will stay that way
    • Script.bat
    • Folder - Arquivos
    • Within the folder: DesktopRefresh.exe and Shortcut.exe
    • 注意:尽管不是最终版本,但它可以与任何类型的文件完美配合.

      Note: Although not the final version it works perfectly with any type of file.

      @编辑

      我刚刚为那些需要相同下载的用户完成了脚本,如下所示: https://www.mediafire.com/?w46t526jjth8drd

      I just finished the script for those who want the same download is below: https://www.mediafire.com/?w46t526jjth8drd

      如果下载失败,则下面是源代码

      注意:同一工作需要其他文件.

@Echo off
Title Criar atalhos em ordem alfab‚tica
mode con:lines=3 cols=25
Color 1f

CD /D "%~dp0"

If Exist "Arquivos\Comando.ini" For /f "usebackq delims=" %%x in ("Arquivos\Comando.ini") do (set "%%x")
If Exist "Arquivos\Config.ini" For /f "usebackq delims=" %%x in ("Arquivos\Config.ini") do (set "%%x")
If Exist "Arquivos\Arquivos.ini" Goto Atalhos
If Exist "Arquivos\Comando.ini" Goto Atalhos
If Exist "Arquivos\Config.ini" Goto Atalhos

for %%F in (""%1"") do Set "Local-dos-Arquivos=%%~F"
for %%F in ("%Local-dos-Arquivos%") do IF "%%~F" NEQ """" Set "Local-dos-Arquivos=%Local-dos-Arquivos:"=%" & Set Numeracao=1 & Goto LocaldosArquivos2

:LocaldosArquivos
mode con:lines=18 cols=78
Set "Local-dos-Arquivos=r1u4unoiwqa6">nul 2>&1
cls
echo  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo  º  Local dos arquivos  º
echo  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo  º ² Arraste a pasta com os arquivos para dentro desta janela ou            º
echo  º ² digite abaixo a localiza‡Æo da mesma.                                  º
echo  º ²                                                                        º
echo  º ² Exemplo: C:\Users\Public\Videos\Animes                                 º
echo  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo.
Set /p Local-dos-Arquivos="¯ Local dos arquivos: " 
Set "Local-dos-Arquivos=%Local-dos-Arquivos:"=%"
Set Numeracao=1
IF "%Local-dos-Arquivos%"=="r1u4unoiwqa6" Goto LocaldosArquivos


:LocaldosArquivos2
mode con:lines=18 cols=78
Set "Menu=">nul 2>&1
cls
echo  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo  º  Local dos arquivos  º
echo  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo  º ² Est  ‚ a localiza‡Æo da pasta com os arquivos?                         º
echo  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo  º
for %%F in ("%Local-dos-Arquivos%") do Echo  º ¯ %%~F
echo  º
echo  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo  º ¯ Menu:                                                                  º
echo  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
echo  º ² (1) Sim                                                                º
echo  º ² (2) NÆo                                                                º
echo  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
Set/p Menu="¯ Menu: "
IF "%Menu%"=="1" Goto Iniciar
IF "%Menu%"=="2" Goto LocaldosArquivos
Goto LocaldosArquivos2

:Iniciar
if not exist "%Local-dos-Arquivos%" Cls & Start /Wait Arquivos\Error.vbs & Goto LocaldosArquivos

:Nome-AnimeSerie1
Set "Serie_Anime=">nul 2>&1
cls
echo  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo  º  Nome do Anime/S‚rie  º
echo  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo  º ² Digite abaixo o nome do Anime/S‚rie.                                   º
echo  º ²                                                                        º
echo  º ² Exemplo: Shigatsu wa Kimi no Uso                                       º
echo  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo.
Set /p Serie_Anime="¯ Nome: " 
IF "%Serie_Anime%"=="" Goto Nome-AnimeSerie1


:Nome-AnimeSerie2
Set "Menu=">nul 2>&1
cls
echo  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo  º  Nome do Anime/S‚rie  º
echo  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo  º ² Este ‚ o nome do Anime/S‚rie?                                          º
echo  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo  º
for %%F in ("%Serie_Anime%") do Echo  º ¯ %%~F
echo  º
echo  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo  º ¯ Menu:                                                                  º
echo  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
echo  º ² (1) Sim                                                                º
echo  º ² (2) NÆo                                                                º
echo  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
Set/p Menu="¯ Menu: "
IF "%Menu%"=="1" Goto Atalhos
IF "%Menu%"=="2" Goto Nome-AnimeSerie1
Goto Nome-AnimeSerie2

:Atalhos
If Exist "Arquivos\Config.ini" For /f "usebackq delims=" %%x in ("Arquivos\Config.ini") do (set "%%x")
Dir /a-d /b "%Local-dos-Arquivos%" >Arquivos\Arquivos.ini
Echo r1u4unoiwqa6.Final >>Arquivos\Arquivos.ini

Set Local-dos-Arquivos > Arquivos\Config.ini
Set Serie_Anime >> Arquivos\Config.ini
Set Numeracao > Arquivos\Comando.ini

If Exist "C:\Users\%username%\Desktop\%ep2% - %Serie_Anime%.lnk" Del /q "C:\Users\%username%\Desktop\%ep2% - %Serie_Anime%.lnk">nul 2>&1 & Start /Min /Wait Arquivos\DesktopRefresh.exe>nul 2>&1

setlocal EnableDelayedExpansion

For /f "usebackq delims=" %%x in ("Arquivos\Comando.ini") do (set "%%x")
For /f "usebackq delims=" %%x in ("Arquivos\Config.ini") do (set "%%x")

set "cmd=findstr /R /N "^^" Arquivos\Arquivos.ini | find /C ":""

for /f %%a in ('!cmd!') do set Numeros=%%a

set Linhas=%Numeracao%
set Atual=1
for /f "delims=" %%a in ('type Arquivos\Arquivos.ini') do (
    for %%b in (!Linhas!) do (
        if !Atual!==%%b Set Ep1=%%a
    )
    set /a "Atual = Atual + 1"
)

Set Ep2=%Ep1%
set "find=*."
call set delete=%%Ep2:!find!=%%
call set Ep2=%%Ep2:!delete!=%%
Set Ep2=%Ep2:.=%

Set Ep1 > Arquivos\Comando.ini
Set Ep2 >> Arquivos\Comando.ini
Set Linhas >> Arquivos\Comando.ini
Set Numeracao >> Arquivos\Comando.ini

endlocal
For /f "usebackq delims=" %%x in ("Arquivos\Comando.ini") do (set "%%x")
For /f "usebackq delims=" %%x in ("Arquivos\Config.ini") do (set "%%x")

IF "%Ep2%"=="r1u4unoiwqa6" Goto Fim

Start /Min /Wait Arquivos\Shortcut.exe /F:"C:\Users\%username%\Desktop\%ep2% - %Serie_Anime%.lnk" /A:C /t:"%Local-dos-Arquivos%\%Ep1%" /D:"Epis¢dio de %Serie_Anime%">nul 2>&1
If Not Exist "C:\Users\%username%\Desktop\[ Atalhos ].lnk" Echo %Serie_Anime%>Arquivos\Atalho.ini & Start /Min /Wait Arquivos\Atalho.vbs>nul 2>&1
Set /A Numeracao = %Linhas% + 1
:::::::::::::::::::::::::::::::::::::::::::::
Set Local-dos-Arquivos > Arquivos\Config.ini
Set Serie_Anime >> Arquivos\Config.ini
:::::::::::::::::::::::::::::::::::::::::::::
Set Ep1 > Arquivos\Comando.ini
Set Ep2 >> Arquivos\Comando.ini
Set Numeracao >> Arquivos\Comando.ini
:::::::::::::::::::::::::::::::::::::::::::::
Exit

:Fim
Del /q "Arquivos\Arquivos.ini">nul 2>&1
Del /q "Arquivos\Atalho.ini">nul 2>&1
Del /q "Arquivos\Comando.ini">nul 2>&1
Del /q "Arquivos\Config.ini">nul 2>&1
Set "Local-dos-Arquivos=">nul 2>&1
Set "Serie_Anime=">nul 2>&1
Set "Linhas=">nul 2>&1
Set "Ep1=">nul 2>&1
Set "Ep2=">nul 2>&1
Start /Wait Arquivos\Final.vbs>nul 2>&1
Goto LocaldosArquivos