Showing posts with label release. Show all posts
Showing posts with label release. Show all posts

Oct 6, 2013

New freeware: CSV2HTML

I was mucking around tables in some widely known text processor and I thought it would be more convenient to have some data in a CSV file so that it could be later transformed into a nice table in HTML. I went ahead and wrote bare skeleton of csv2html in batch back in September, and later I thought I could share this with others. And here it is, simple free in-notepad-written script for converting CSV to HTML. What's not in anywhere, and what you may find useful: if you want to look up its command line parameters, you needn't execute it from the Command Prompt. It is enough to double-click csv2html.cmd to look up the parameters, as it will wait ten seconds before terminating (see the countdown timer in the window title as you started it).
Please read the file from_the_author.txt, which is inside the ZIP file.

[Download]

May 5, 2012

New freeware: M3UGen, simple batch playlist maker

Here comes my next freeware. It is very simple and does not support non-ANSI/diacritic characters.
It uses m3ugen.ini file, which can be freely customized.
That INI file syntax is:


Item1_name=Text to be displayed
Item1_data=semicolon-separated file extensions to be matched
...
Item2147483647_name=Text to be displayed #2147483646
Item2147483647_data=extensions...


This script demonstrates the usage of my dynamic choice algorithm, which bases on the content of its INI file; the choice list is created dynamically, count is not fixed in batch file itself.
It's just a simple file lister matching files of chosen extension(s).


The script:
@echo off
setlocal EnableDelayedExpansion
echo.
echo  M3UGen v1.00 (c)2012 Michal Hanebach
echo.
call:ValidateIni||(
:inicorrupted
 echo  INI file corrupted.
 goto end
)
set/a itemcount=( %linecount% / 2 )
for /l %%A in (1,1,%itemcount%) do (
 call:GetNextItemFromIniFile %%A
)
for /l %%A in (1,1,%itemcount%) do (
 call:PrintNameOfItemOfIndex %%A
)
echo.
echo  [x] exit
:WaitForUserInput
echo.
set ch=
set /p ch=úChoose one of the three   
if defined ch (
 set ch=%ch:"=%
) else (
 goto WaitForUserInput
)
if /i "%ch%"=="x" exit
call:IsInteger %ch%||(
 echo  [%ch%] is not a positive integer value
 goto WaitForUserInput
)
call:TranslateMessage %ch%
if "%errorlevel%"=="2" (echo.&echo  Out of range [1..%itemcount%])
if "%errorlevel%"=="3" (goto inicorrupted)
if not "%errorlevel%"=="0" (goto WaitForUserInput)
set itemcount=
set linecount=
:loop0
echo.
set ch=&set/p ch=úDrag directory here or press ENTER for the current folder   
if not defined ch (
 set source=%~dp0
 set source=!source:~0,-1!
) else (
 if exist "!ch!" (
  set source=!ch!
 ) else (
  goto loop0
 )
)
set source=!source:"=!
:loop1
echo.
set ch=&set/p ch=úType in playlist file name   
if not defined ch (goto loop1)
set fname=!ch!
if /i "!fname:~-4!"==".m3u" (set fname=!fname:~0,-4!)
set ch=
for %%A in (%fextpat%) do (call:BuildUpTheList %%A&&echo  Added files of type: %%A&&set/a succ_cnt+=1)
if not defined succ_cnt (echo  None files added&goto end)
set succ_cnt=
sort queue.$$$ /O !fname!.m3u
goto end
:BuildUpTheList
dir/b "!source!\*.%1">nul 2>&1||(
 call:ThrowErrorLevel dummy 1
 goto BuildUpTheList_procend
)
for /f "tokens=*" %%A in ('dir/b "%source%\*.%1"') do (echo !source!\%%A>>queue.$$$)
call:ThrowErrorLevel dummy 0
:BuildUpTheList_procend
exit/b%errorlevel%
:ThrowErrorLevel
if defined %1 set %1=
exit/b%2
:ValidateIni
for /f %%G in ('type m3ugen.ini') do (set/a linecount+=1)
set/a remainder=( %linecount% %% 2 )
if not "%remainder%"=="0" (call:ThrowErrorLevel remainder 1) else (call:ThrowErrorLevel remainder 0)
exit/b%errorlevel%
:GetNextItemFromIniFile
for %%A in ( Item%1_name Item%1_data ) do (for /f "tokens=1,* delims=,=" %%G in (m3ugen.ini) do (if "%%G"=="%%A" (set %%A=%%H)))
exit/b0
:PrintNameOfItemOfIndex
for /f "tokens=1,* delims=,=" %%G in ('set Item%1_name') do (echo  %1 %%H)
exit/b0
:TranslateMessage
if %1 GTR %itemcount% exit/b2
if %1 LSS 1 exit/b2
set Item%1_name>nul 2>&1||exit/b3
set Item%1_data>nul 2>&1||exit/b3
for /f "tokens=2* delims=,=" %%G in ('set Item%1_data') do (set fextpat=%%G %%H)
exit/b0
:IsInteger
set tempvar=%1
:iilp
set firstchar=%tempvar:~0,1%
call:CheckIfDigit||(
 call:IsInteger_flushvars /failure||(
  exit/b1
 )
)

set tempvar=%tempvar:~1%
if "%tempvar%"=="" goto IsInteger_eol
goto iilp
:IsInteger_eol
call:IsInteger_flushvars
exit/b0
:CheckIfDigit
if "%firstchar%"=="0" ( exit/b0 )
if "%firstchar%"=="1" ( exit/b0 )
if "%firstchar%"=="2" ( exit/b0 )
if "%firstchar%"=="3" ( exit/b0 )
if "%firstchar%"=="4" ( exit/b0 )
if "%firstchar%"=="5" ( exit/b0 )
if "%firstchar%"=="6" ( exit/b0 )
if "%firstchar%"=="7" ( exit/b0 )
if "%firstchar%"=="8" ( exit/b0 )
if "%firstchar%"=="9" ( exit/b0 )
exit/b1
:IsInteger_flushvars
for %%A in ( tempvar firstchar ) do (if defined %%A (set %%A=))
if "%1"=="/failure" (exit/b1)
exit/b0
:end
if exist queue.$$$ del queue.$$$
set source=
set fextpat=
echo.
echo  ^< Any key to exit ^>
pause>nul 2>&1
endlocal
Example INI file (has to be called m3ugen.ini):
Item1_name=MP3 only
Item1_data=mp3

Item2_name=FLAC only
Item2_data=flac

Item3_name=all audio formats possible
Item3_data=aac;asf;cda;flac;kar;mid;midi;miz;mp1;mp2;mp3;nsa;ogg;rmi;vlb;wav;wma

Jan 27, 2012

New freeware: SuppressDwmPerformancePrompts

SuppressDwmPerformancePrompts may fix WDM interrupting games as well as resource heavy applications with an annoying message about the Aero color scheme being changed or turned off. Examples:



The bottom line is game start time. This script disables Aero, starts game while a simultaneous Command Prompt's instance is counting down to turn Aero back on, thus (not necessarily) preventing WDM from showing the interrupting message. The reason you may want Aero turned back on is because game recorders such as Fraps require Aero to be running in order to record both your desktop as well as your gameplay if, say, you are doing a video tutorial that needs to include both simultaneously. This script's main purpose though is to prevent WDM from disrupting your gameplay with messages like the ones pictured above.

[Download]
Please see the page dedicated to this little program, it is in the link bar on top of this blog.

Update May 26th, 2015: Please see SuppressDwmPerformancePrompts64

Sep 2, 2011

New freeware: RegXchg

This utility will allow you to switch specified registry value between two given data, for example changing hidden files' showing state (xchg_hidden.cmd inside distribution package). As of yet, it supports DWORD values only; it's meant to alternate *yes/no* system settings. To get detailed info on how to use it, download it, unpack to %windir%\System32 and call (from elevated command prompt) with /? switch.