[過去ログ] 【.cmd】 バッチファイルスクリプト %12 【.bat】©2ch.net (1002レス)
上下前次1-新
抽出解除 必死チェッカー(本家) (べ) 自ID レス栞 あぼーん
このスレッドは過去ログ倉庫に格納されています。
次スレ検索 歴削→次スレ 栞削→次スレ 過去ログメニュー
リロード規制です。10分ほどで解除するので、他のブラウザへ避難してください。
602(1): 2018/07/12(木)14:54 ID:+klw6xr1(1/9)調 AAS
>>569 無理矢理にバッチで書いてみた
@echo off
set "a=%cmdcmdline:"=""%"
setlocal enabledelayedexpansion
set /a b=0,n=0
set "s=" & set "d=""
:x1
if not "!a:~%b%,1!"=="/" set /a b+=1 & goto x1
:x2
if "!a:~%b%,1!"=="!d!" set /a n+=1
if !n! equ 6 set /a b+=2 & goto x3
set /a b+=1 & goto x2
:x3
set "a=!a:~%b%,-2! " & set /a b=0
:x4
if not defined a goto x8
if "!a:~%b%,1!"=="!d!" set /a n=0 & goto x6
下に続く
603: 2018/07/12(木)14:54 ID:+klw6xr1(2/9)調 AAS
:x5
if not "!a:~%b%,1!"==" " set /a b+=1 & goto x5
set "s=!s!!d!!d!!a:~0,%b%!!d!!d! " & set /a b+=1
set "a=!a:~%b%!" & set /a b=0 & goto x4
:x6
if "!a:~%b%,1!"=="!d!" set /a n+=1
if !n! equ 4 set /a b+=1 & goto x7
set /a b+=1 & goto x6
:x7
set "s=!s!!a:~0,%b%! " & set /a b+=1
set "a=!a:~%b%!" & set /a b=0 & goto x4
:x8
set "s=!s:""="!"
endlocal & set s=%s%
for %%f in (%s%) do echo "%%~nxf"
pause
606(1): 2018/07/12(木)20:48 ID:+klw6xr1(3/9)調 AAS
レスありがとう
でもこちらでは再現できない
出来たら具体例を
607: 2018/07/12(木)21:08 ID:+klw6xr1(4/9)調 AAS
もしかしたらset文の行末にスペースがありませんかね?
行末のスペースが有ったら全て削除してみて下さい
609: 2018/07/12(木)21:31 ID:+klw6xr1(5/9)調 AAS
バッチファイル名にスペースがあると不味いようです
610: 2018/07/12(木)21:37 ID:+klw6xr1(6/9)調 AAS
違うな...
ファイル名なんですか?
613: 2018/07/12(木)21:52 ID:+klw6xr1(7/9)調 AAS
バッチファイル名
"test.bat" がOK, "test - コピー.bat" が NG
"ー" がダメ文字っぽい
なんだこりゃ
614: 2018/07/12(木)22:45 ID:+klw6xr1(8/9)調 AAS
>>612
とりあえず最初の3行を
@echo off
setlocal enabledelayedexpansion
set "a=!cmdcmdline:"=""!"
set "a=!a:ー=/1!"
最後の5行を
:x8
set "s=!s:/1=ー!"
set "s=!s:""="!"
endlocal & set s=%s%
for %%f in (%s%) do echo "%%~nxf"
pause
ダメ文字の詳細は不明
まだ有ったら、/2 /3 ... 置換
615: 2018/07/12(木)23:31 ID:+klw6xr1(9/9)調 AAS
これも追加
5行目
set "a=!a:―=/2!"
:x8の次の行に
set "s=!s:/2=―!"
上下前次1-新書関写板覧索設栞歴
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル
ぬこの手 ぬこTOP 0.049s