@echo off
REM Paste clipboard content to new file. Text or image (image format determined by extension).
REM Filename in parameter. Defaults to current date-time.
set nircmd=B:\Progs\AUTO\NirLauncher\NirSoft\nircmd-x64.exe
if not [%1]==[] goto havearg
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set dt=%%I
set fname=%dt:~0,4%-%dt:~4,2%-%dt:~6,2%_%dt:~8,6%
start "" /wait %nircmd% clipboard writefile %fname%
if not exist %fname% %nircmd% clipboard saveimage %fname%
exit /b
:havearg
set arg=%1
set arg=%arg:~0,1%
set arg=%arg:"=///%
if ///==%arg% (
start "" /wait %nircmd% clipboard writefile %*
if not exist %* %nircmd% clipboard saveimage %*
) else (
start "" /wait %nircmd% clipboard writefile "%*"
if not exist "%*" %nircmd% clipboard saveimage "%*"
)
|