Solved: CMD – Comma And Apostrophe In File Name

working with com.whatsapp_2.17.35' 8-452027_minAPI15(armeabi,armeabi-v7a,mips,x86)(nodpi)_apkmirror.com.apk,
the %1, %~1 tries to parse a list of arguments
and will give you: com.whatsapp_2.17.35' 8-452027_minAPI15(armeabi.

%~s1 will fail too.

A workaround:
gulp the entire thing,
and re-parse content into short-path for easier usage.

@echo off
::                              enable Unicode support for path/file-name.
chcp 65001 2>nul >nul

::                              single arg - workaround weird file-name.
set "ARG=%*"
for /f %%a in ("%ARG%") do ( set 'ARG=%%~fsa' )

pure CMD:
the code above will generate a fully-qualified,
short (8.3-DOS like) path.

if you do need to pass more than one argument,
this is not the solution for you.

– – – – – –

The above code does not always works
since it will turn off any tries to parse single argument from the string,

Passing %* to other programs as an argument will always work,
but built-in handling of file-names, with apostrophes will still fail,
due to “by design” issues in CMD (wrapping phrases uses apostrophes..)

instead, try passing %* to GetShortPathName.exe from github.com/eladkarako/GetShortPathName,
with the additional processing allowing empty-strings/empty-character (\0) and Windows API.
it will return a short 8.3 version of the path (relative or full),
if you want a fully qualified path try using GetFullPathName.exe from github.com/eladkarako/GetFullPathName.

You can use your choice of implementations, that simple one is written in VB6.

CMD NewLine Character

set NEWLINE=^& echo.
echo hello%NEWLINE%world

And You’ll get

Hello
World

Aria2C Batch File For Quick Download

Copy to following CMD batch-file content into a new file,
and name it aria2download.cmd.

Place the file in the same folder as your aria2c.exe,
make sure it is your system-PATH,

and you can now enter aria2download "http..your-url..."
for a quick file-download to the current folder you are in.

All the important-switches are already set, such as maximum split value, and maximum connections per-server for ultra-fast download and an extra permissive-SSL to allow you to download from secure-servers without certificate verifying and a browser-like useragent and referrer value to generate a compatible download session with servers that often will block download-managers. You can easily personalise the batch-file to include an additional headers, authentications, etc…

Continue reading

cURL – Latest Chromium Downloader

echo off
::stuff you can modify.
::--------------------------------------------------------------------------------
::                          http|https
set PROTOCOL=http
::                          snapshots|continuous
set BRANCH=snapshots
::                          Android|Arm|Linux|LinuxGit|LinuxGit_x64|Linux_ARM_Cross-Compile|Linux_ChromiumOS|Linux_ChromiumOS_Full|Linux_x64|Mac|MacGit|Win|WinGit|Win_x64|chromium-full-linux-chromeos
set OS=Win_x64
::                          mini_installer.exe|REVISIONS|chrome-win32-syms.zip|chrome-win32.zip|pnacl.zip|content-shell.zip|gcapi.zip|metrics-metadata.zip|remoting-host.msi|remoting-me2me-host-win.zip|devtools_frontend.zip|chrome-linux.zip|changelog.xml|chrome-android.zip
set FILE=mini_installer.exe
::--------------------------------------------------------------------------------


::stuff you should keep as is.
::--------------------------------------------------------------------------------
set URL_LASTCHANGE=%PROTOCOL%://storage.googleapis.com/chromium-browser-%BRANCH%/%OS%/LAST_CHANGE

set COMMAND_CURL_FORVERSION=curl.exe --silent --http2 --ipv4 --anyauth --insecure --location-trusted --ssl-allow-beast --ssl-no-revoke --url "%URL_LASTCHANGE%"

set VERSION=
for /f "tokens=*" %%a in ('call %COMMAND_CURL_FORVERSION% 2^>^&1') do (set VERSION=%%a)
::error handling
if ["%VERSION%"] == [""] ( goto NOVERSION )
set URL_DOWNLOAD=%PROTOCOL%://storage.googleapis.com/chromium-browser-%BRANCH%/%OS%/%VERSION%/%FILE%

echo.
echo Got Latest-Version: ^>%VERSION%^< ^[Branch:%BRANCH%/OS:%OS%^]
::--------------------------------------------------------------------------------


::you should enable one-of-your-prefered downloaders.
::goto DOWNLOAD_CURL
::goto DOWNLOAD_WGET
::goto DOWNLOAD_ORBITDOWNLOADER
goto DOWNLOAD_ARIA2C



::you should not reach here, unless
::you've forgot to enable one of the "downloader lines" (above)...
goto NODOWNLOADER


::--------------------------------------------------------------------------------
:NOVERSION
  echo ERROR: could not get the latest version...
  goto EXIT

:NODOWNLOADER
  echo ERROR: please enable one of the downloader lines..
  goto EXIT


:DOWNLOAD_CURL
  echo Start Download using cURL...
  call curl.exe --verbose --http2 --ipv4 --ignore-content-length ^
                --anyauth --insecure --location-trusted          ^
                --ssl-allow-beast --ssl-no-revoke --tcp-fastopen ^
                --tcp-nodelay --use-ascii --url "%URL_DOWNLOAD%"
  goto EXIT


:DOWNLOAD_WGET
  echo Start Download using wGET...
  call wget.exe --directory-prefix="." --debug --user-agent="Mozilla/5.0 Chrome" --continue ^
                --server-response --no-check-certificate --secure-protocol=auto  "%URL_DOWNLOAD%"
  goto EXIT


:DOWNLOAD_ARIA2C
  echo Start Download using Aria2C...
  call aria2c.exe --allow-overwrite=true         --auto-file-renaming=false         --check-certificate=false        ^
                  --check-integrity=false        --connect-timeout=120              --console-log-level=notice       ^
                  --continue=true                --dir="."                          --disable-ipv6=true              ^
                  --enable-http-keep-alive=true  --enable-http-pipelining=true      --file-allocation=prealloc       ^
                  --http-auth-challenge=false    --human-readable=true              --max-concurrent-downloads=16    ^
                  --max-connection-per-server=16 --max-tries=3                      --min-split-size=1M              ^
                  --retry-wait=1                 --rpc-secure=false                 --split=8                        ^
                  --timeout=120                  --user-agent="Mozilla/5.0 Chrome"  "%URL_DOWNLOAD%"
  goto EXIT


:DOWNLOAD_ORBITDOWNLOADER
  echo Start Download using OrbitDownloader...
  call "C:\Program Files (x86)\Orbitdownloader\orbitdm.exe" "%URL_DOWNLOAD%"
  goto EXIT


:EXIT  
  echo.
  echo Done.
  pause


::--------------------------------------------------------------------------------------------
::--------------------------------------------------------------------------------------------
::
::   - "http"           - http protocol is faster to connect and download with OrbitDownloader and wGet, it also means your PC won't preform certificate exchange with the remote machine.
::   - "snapshots"      - snapshots is newer, "continuous" is more stable (but might be very old).
::   - "OS" and "FILE"  - are what you want to download
::
::
:: snapshots    - newest (unstable) newest code-changes - passed unit-tests + compilation.
:: continuous   - old    (stable)                       - passed unit-tests + compilation + test-suits.
:: ------------------------------------------------------------------------------------------------------
::   branch   |  branch description           |  version-based build
:: ___________|_______________________________|_____________________________________________________________________________________________
::   Win_x64  |  Chromium Installer (64-bit)  |  storage.googleapis.com/chromium-browser-continuous/Win_x64/{version}/mini_installer.exe  
::   Win_x64  |  Chromium Package (64-bit)    |  storage.googleapis.com/chromium-browser-continuous/Win_x64/{version}/chrome-win32.zip    
::   Win      |  Chromium Installer (32-bit)  |  storage.googleapis.com/chromium-browser-continuous/Win/{version}/mini_installer.exe
::   Win      |  Chromium Package (64-bit)    |  storage.googleapis.com/chromium-browser-continuous/Win/{version}/chrome-win32.zip    
::
::
::------------------------------------------------------
::- SCRIPT WAS WRITTEN AND MAINTAINED BY ELAD KARAKO.  -
::- LAST UPDATED: JULY, 2017. FREE TO USE UNDER GNU.   -
::------------------------------------------------------

Download tools..

aria2c Sample – Chromium Command-Line Switch Updater

Getting the most updated command-line switches for Chromium (Google-Chrome base code) is always a work in progress,
since this is a `live code` you can never say “Ok, I’m Done”, there will always be a new one, or old one retired from being actively used in the, well.., actual code.
So if you’re relaying on command-line switches in your scripts, or just want to try out new features before the `bleed into` the actual Google-Chrome main version, you probably want to bookmark this article :]]

Continue reading

CMD Ninja – Relative To Fully Qualified Path And Other File Properties Without Directing Relative Path To Another CMD-File As An Argument

Given the following directory-tree
icompile.eladkarako.com_cmd_file_path_properties_short_relative_file_name_directory_folder_without_sending_to_another_cmd_file_as_argument_args

I want to get some information on apktool_2.0.2.jar
for example fully-qualified short (old dos 8.3 format that is compatible with old Java argument’ing) path,

here is a snippet containing it,
this ‘_’ prefix is advisable, the double ‘%’ is to escape the loop’s variable, the ‘~’ is to strip any \’ \” wrapping chars around the path (best practice, always use it), the reason ‘_drive’ phrase has (also) ‘s’ in it is to make the result more letter-case consistent (the 8.3 format uses Upper-Case while if you’ll run CMD console and browse or change-dir using a Lower-Case drive letter it will be embodied in the result).

@echo off
set relative=.\apktool_2.0.2.jar

for /f %%a in ("%relative%")do (set "_full=%%~fa"     )
for /f %%a in ("%relative%")do (set "_full83=%%~fsa"  )
for /f %%a in ("%relative%")do (set "_drive=%%~dsa"   )
for /f %%a in ("%relative%")do (set "_path=%%~pa"     )
for /f %%a in ("%relative%")do (set "_path83=%%~psa"  )
for /f %%a in ("%relative%")do (set "_name=%%~na"     )
for /f %%a in ("%relative%")do (set "_name83=%%~nsa"  )
for /f %%a in ("%relative%")do (set "_ext=%%~xa"      )
for /f %%a in ("%relative%")do (set "_ext83=%%~xsa"   )
for /f %%a in ("%relative%")do (set "_att=%%~aa"      )
for /f %%a in ("%relative%")do (set "_time=%%~ta"     )
for /f %%a in ("%relative%")do (set "_size=%%~za"     )

echo %_full%
echo %_full83%
echo %_drive%
echo %_path%
echo %_path83%
echo %_name%
echo %_name83%
echo %_ext%
echo %_ext83%
echo %_att%
echo %_time%
echo %_size%

::------------------------------------------------------------::
::  relative  < ->  .\apktool_2.0.2.jar                        ::
::------------------------------------------------------------::
::  _full     < ->  D:\DOS\android\bin\apktool_2.0.2.jar       ::
::  _full83   < ->  D:\DOS\android\bin\APKTOO~1.JAR            ::
::  _drive    < ->  D:                                         ::
::  _path     < ->  \DOS\android\bin\                          ::
::  _path83   < ->  \DOS\android\bin\                          ::
::  _name     < ->  apktool_2.0.2                              ::
::  _name83   < ->  APKTOO~1                                   ::
::  _ext      < ->  .jar                                       ::
::  _ext83    < ->  .JAR                                       ::
::  _att      < ->  --a------                                  ::
::  _time     < ->  10/14/2015 02:06 PM                        ::
::  _size     < ->  6329931                                    ::
::------------------------------------------------------------::

CMD Ninja – Unlimited Arguments Processing, Identifying If Exist In File-System, Identifying If File Or Directory

@echo off

:loop
      ::-------------------------- has argument ?
      if ["%~1"]==[""] (
        echo done.
        goto end
      )
      ::-------------------------- argument exist ?
      if not exist %~s1 (
        echo not exist
      ) else (
        echo exist
        if exist %~s1\NUL (
          echo is a directory
        ) else (
          echo is a file
        )
      )
      ::--------------------------
      shift
      goto loop
      
      
:end

pause

save it as identifier.cmd
it can identify an unlimited arguments (normally you are limited to %1%9), just remember to wrap the arguments with inverted-commas, or use 8.3 naming, or drag&drop them over (it automatically does either of above).

this allows you to run the following commands:
identifier.cmd c:\windows
and to get

exist
is a directory
done

identifier.cmd "c:\Program Files (x86)\Microsoft Office\OFFICE11\WINWORD.EXE"
and to get

exist
is a file
done

and multiple arguments (of course this is the whole-deal..)
identifier.cmd c:\windows\system32 c:\hiberfil.sys "c:\pagefile.sys" hello-world
and to get

exist
is a directory
exist
is a file
exist
is a file
not exist
done.

naturally it can be a lot more complex,
but nice examples should be simple and minimal.

also posted at StackOverflow:

Explorer To Cygwin – Open In Folder

replace the Cygwin.bay under c:\cygwin\ with this content,

@echo off
::force UTF-8 support
chcp 65001

if "%1"=="" (
  goto START_STANDARD
) else (
  goto START_IN_FOLDER
)


:START_STANDARD
  call C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico -
  goto EXIT
  

:START_IN_FOLDER
  rem  remove [\'\"] from first arg
  set CURRENT=%~1
  rem  backward2forward slash
  set CURRENT=%CURRENT:\=/%
  rem  remove ":" after the drive letter
  set CURRENT=%CURRENT::/=/%
  rem  adds prefix (used in cygwin as dummy drive-mounts)
  set CURRENT=/cygdrive/%CURRENT%
  rem  ------------------------------------------------------------
  call C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico c:\cygwin\bin\bash.exe -l -c "cd \"%CURRENT%\" ; exec bash" -
  goto EXIT


:EXIT

or download the following file instead: Cygwin.bat (here is the original file: Cygwin.bat.bak)

if you’ll pass a folder path as argument to the batch (no checks.. q&d..) it will open cygwin in this path, in any other case, just open cygwin in home-directory (standard run..)

2015-12-05_034648

place a shortcut in your SENDTO folder,
and then right-click a folder and select the shortcut from the sendto-menu

or better yet, download the following reg file: open_in_cygwin.reg and double click it,

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\open_in_cygwin]
@="Open In Cy&gwin"

[HKEY_CLASSES_ROOT\Directory\shell\open_in_cygwin\command]
@="\"C:\\cygwin\\Cygwin.bat\" \"%1\""

it will add a new context-menu item for each folder:
2015-12-05_040001

download and run the following file to uninstall the context-menu item: open_in_cygwin_uninstall.reg

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\shell\open_in_cygwin]

July 29th, 2017 – Update.

Here is a slightly modified version of the “start cygwin from a folder”, that runs few checks before the actual execute stage, it wraps things with ", and very carefully handles long and short paths, passing paths correctly to cygwin terminal application, also, it does not uses hard-coded paths, so if your cygwin folder placed somewhere else it will work just fine for you :]

@echo off
::              set code-page for UTF-8 charset.
chcp 65001

::              normalise to fully qualified path. short path (8.3) is used for testing the path.
set FOLDER=%~s1
for /f %%a in ("%FOLDER%") do ( set "FOLDER=%%~fsa" )

::              verify existing folder.
if ["%FOLDER%"]==[""]         ( goto RUN_STANDARD   )
if not exist %FOLDER%         ( goto RUN_STANDARD   )
if not exist %FOLDER%\NUL     ( goto RUN_STANDARD   )

goto RUN_FOLDER


::--------------------------------------------------------


:RUN_FOLDER
::             prefer long-path.
  set FOLDER=%~1
  echo.
  echo Starting Cygwin From ^[%FOLDER%^] ...
::             convert to cygwin-compatible path (forward-slash, removing drive's ":" and /cygdrive/ as root)
  set FOLDER=%FOLDER:\=/%
  set FOLDER=%FOLDER::/=/%
  set FOLDER=/cygdrive/%FOLDER%
  call "%~dp0bin\mintty.exe" "-i" "/Cygwin-Terminal.ico" %~dp0bin\bash.exe -l -c "cd \"%FOLDER%\"; exec bash" - 2>nul >nul
  goto EXIT


:RUN_STANDARD
  echo.
  echo Starting Cygwin From Home...
  call "%~dp0bin\mintty.exe" "-i" "/Cygwin-Terminal.ico" "-"   2>nul >nul
  goto EXIT


:EXIT

Latest Google-Closure-JSLinter (GJSLint) – Download and Extract

set sUserAgent="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1456.0 Safari/537.36"
set sURL=http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz
set sDownloadfile=closure_linter-latest.tar.gz

::rename existing to old_*
if exist %sDownloadfile% (
    ren %sDownloadfile% old_%sDownloadfile% >nul
)

::download new version
.\_res\wget.exe --continue --server-response --directory-prefix=. --user-agent=%sUserAgent% %sURL%

::extract
if exist %sDownloadfile% (
    ::extract archive  -- x=eXtract, z=filter through gZip, v=be Verbose(show activity), f=filename.
   .\_res\tar xzvf %sDownloadfile%

   ::remove archive file
   del /f /q %sDownloadfile% >nul
)

pause

You can download the entire script with resources (wget to download and tar to extract the “closure_linter-latest.tar.gz” file into a folder (plain easy tar xzvf closure_linter-latest.tar.gz where x=eXtract, z=filter through gZip, v=be Verbose(show activity), f=filename).

latest_linter_with_wget_and_tar.rar

Windows CMD Multi Process Example

break a long, sequential task, into multi-process higher CPU-usage, quick solution.

example – download a long list of playlist very quick.

you are going to have 2 cmd files in the same folder.
make sure you have wget (either in the same folder or in your %path% environment variable).

file name: playlist__start_all.cmd
file content:

::@echo off
echo I am the runner

set sURL=http://listen.di.fm/public3/ambient.pls              ^
         http://listen.di.fm/public3/breaks.pls               ^
         http://listen.di.fm/public3/chillout.pls             ^
         http://listen.di.fm/public3/chilloutdreams.pls       ^
         http://listen.di.fm/public3/chiptunes.pls            ^
         http://listen.di.fm/public3/classiceurodance.pls     ^
         http://listen.di.fm/public3/classictechno.pls        ^
         http://listen.di.fm/public3/classictrance.pls        ^
         http://listen.di.fm/public3/classicvocaltrance.pls   ^
         http://listen.di.fm/public3/club.pls                 ^
         http://listen.di.fm/public3/clubdubstep.pls          ^
         http://listen.di.fm/public3/cosmicdowntempo.pls      ^
         http://listen.di.fm/public3/deephouse.pls            ^
         http://listen.di.fm/public3/deepnudisco.pls          ^
         http://listen.di.fm/public3/discohouse.pls           ^
         http://listen.di.fm/public3/drumandbass.pls          ^
         http://listen.di.fm/public3/dubstep.pls              ^
         http://listen.di.fm/public3/electro.pls              ^
         http://listen.di.fm/public3/epictrance.pls           ^
         http://listen.di.fm/public3/eurodance.pls            ^
         http://listen.di.fm/public3/funkyhouse.pls           ^
         http://listen.di.fm/public3/futuresynthpop.pls       ^
         http://listen.di.fm/public3/goapsy.pls               ^
         http://listen.di.fm/public3/handsup.pls              ^
         http://listen.di.fm/public3/hardcore.pls             ^
         http://listen.di.fm/public3/harddance.pls            ^
         http://listen.di.fm/public3/hardstyle.pls            ^
         http://listen.di.fm/public3/house.pls                ^
         http://listen.di.fm/public3/latinhouse.pls           ^
         http://listen.di.fm/public3/liquiddnb.pls            ^
         http://listen.di.fm/public3/lounge.pls               ^
         http://listen.di.fm/public3/minimal.pls              ^
         http://listen.di.fm/public3/oldschoolacid.pls        ^
         http://listen.di.fm/public3/progressive.pls          ^
         http://listen.di.fm/public3/progressivepsy.pls       ^
         http://listen.di.fm/public3/psychill.pls             ^
         http://listen.di.fm/public3/soulfulhouse.pls         ^
         http://listen.di.fm/public3/spacemusic.pls           ^
         http://listen.di.fm/public3/techhouse.pls            ^
         http://listen.di.fm/public3/techno.pls               ^
         http://listen.di.fm/public3/trance.pls               ^
         http://listen.di.fm/public3/tribalhouse.pls          ^
         http://listen.di.fm/public3/ukgarage.pls             ^
         http://listen.di.fm/public3/vocalchillout.pls        ^
         http://listen.di.fm/public3/vocaltrance.pls          ^
         http://somafm.com/480min.pls                         ^
         http://somafm.com/beatblender.pls                    ^
         http://somafm.com/bootliquor.pls                     ^
         http://somafm.com/brfm.mp3                           ^
         http://somafm.com/cliqhop.pls                        ^
         http://somafm.com/covers.pls                         ^
         http://somafm.com/digitalis.pls                      ^
         http://somafm.com/dronezone.pls                      ^
         http://somafm.com/dubstep.pls                        ^
         http://somafm.com/groovesalad.pls                    ^
         http://somafm.com/illstreet.pls                      ^
         http://somafm.com/indiepop.pls                       ^
         http://somafm.com/lush.pls                           ^
         http://somafm.com/missioncontrol.pls                 ^
         http://somafm.com/poptron.pls                        ^
         http://somafm.com/sf1033.pls                         ^
         http://somafm.com/sonicuniverse.pls                  ^
         http://somafm.com/spacestation.pls                   ^
         http://somafm.com/suburbsofgoa.pls                   ^
         http://somafm.com/sxfm.pls                           ^
         http://somafm.com/tags.pls                           ^
         http://somafm.com/u80s.pls                           ^
         http://www.di.fm/mp3/djmixes.pls                     ^
         http://www.fresh.fm/media/audio/ListenHigh.pls       ^
         http://www.sky.fm/mp3/altrock.pls                    ^
         http://www.sky.fm/mp3/beatles.pls                    ^
         http://www.sky.fm/mp3/bossanova.pls                  ^
         http://www.sky.fm/mp3/christian.pls                  ^
         http://www.sky.fm/mp3/classical.pls                  ^
         http://www.sky.fm/mp3/classicrap.pls                 ^
         http://www.sky.fm/mp3/classicrock.pls                ^
         http://www.sky.fm/mp3/country.pls                    ^
         http://www.sky.fm/mp3/datempolounge.pls              ^
         http://www.sky.fm/mp3/guitar.pls                     ^
         http://www.sky.fm/mp3/hit70s.pls                     ^
         http://www.sky.fm/mp3/indierock.pls                  ^
         http://www.sky.fm/mp3/jazz.pls                       ^
         http://www.sky.fm/mp3/lovemusic.pls                  ^
         http://www.sky.fm/mp3/newage.pls                     ^
         http://www.sky.fm/mp3/oldies.pls                     ^
         http://www.sky.fm/mp3/pianojazz.pls                  ^
         http://www.sky.fm/mp3/rootsreggae.pls                ^
         http://www.sky.fm/mp3/salsa.pls                      ^
         http://www.sky.fm/mp3/smoothjazz.pls                 ^
         http://www.sky.fm/mp3/solopiano.pls                  ^
         http://www.sky.fm/mp3/soundtracks.pls                ^
         http://www.sky.fm/mp3/the80s.pls                     ^
         http://www.sky.fm/mp3/tophits.pls                    ^
         http://www.sky.fm/mp3/uptemposmoothjazz.pls          ^
         http://www.sky.fm/mp3/urbanjamz.pls                  ^
         http://www.sky.fm/mp3/world.pls                      ^
         http://www.sky.fm/wma/altrock.asx                    ^
         http://www.sky.fm/wma/classicrock.asx                ^
         http://www.sky.fm/wma/indierock.asx                  ^
         http://www.sky.fm/wma/salsa.asx                      ^
         http://www.somafm.com/secretagent.pls

::-----------------------------------------------
:: init stage.
:: remove old files
    attrib -H .\*.pls                              >nul
    attrib -H .\*.asx                              >nul

    if exist .\*.pls  del /f /q .\*.pls            >nul
    if exist .\*.asx  del /f /q .\*.asx            >nul




for %%e in (%sURL%) do (
    ::parallel diffrent process. and continue.
    start /min /low "cmd /c "call playlist__file_downloader.cmd %%e""
)

file name: playlist__file_downloader.cmd
file content:

@echo off

set sUserAgent="Mozilla/5.0 (Windows NT 5.2; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1"

wget --directory-prefix=. --debug --user-agent=%sUserAgent% %1



::-------------------------------------------
:: file name fix
if exist "dubstep.pls.1"   ren "dubstep.pls.1"   "dubstep2.pls"   >nul
if exist "the80s.pls"      ren "the80s.pls"      "80s.pls"        >nul
if exist "hit70s.pls"      ren "hit70s.pls"      "70s.pls"        >nul
if exist "mpg128.pls"      ren "mpg128.pls"      "woxy.pls"       >nul
if exist "ListenHigh.pls"  ren "ListenHigh.pls"  "freshfm.pls"    >nul

:: set file-attribute hidden.
:::::: attrib +H .\*.pls
:::::: attrib +H .\*.asx

exit

now you execute “playlist__start_all.cmd” and the long list of files will be break (space separated)
and for each file there will be a secondary batch execution of “playlist__file_downloader.cmd” with the file name as argument.

Chromium Installer – Download Latest Nightly-Build Snapshot

figured it out.

1.
get latest revision number from this url: http://commondatastorage.googleapis.com/chromium-browser-continuous/Win/LAST_CHANGE

2.
concat it to this url, to get into the FTP of this (meaning the latest) revision
http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Win/put revision number here/

I’ve made a small VB6 program that uses Win32 API to download the latest revision number and send it to the STDOUT,
and a CMD (batch file) that reads it and use wGet to download the execute.

wget has custom settings like using reffer url, cookie, user-agent, avoiding cache, re-write the mime-type, longer keep-alive, tring few times, downloading backup in case of an error- can re download from the same point,
all like the execute was downloaded from a browser.

::  browse
::  http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html
::  http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Win/
::  http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Win/
::  https://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Win/
::  https://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Win/144914/
::  for more information.

@echo off
::static information init.
set sUserAgent="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; WOW64; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)"
set sUrl_Protocol=https
set sUrl_Base=commondatastorage.googleapis.com/chromium-browser-continuous/Win
set sUrl_FileName=mini_installer.exe



setlocal enableextensions
    :: sVersionNumber init.
    set sVersionNumber=""
    set sUrl_Version=http://commondatastorage.googleapis.com/chromium-browser-continuous/Win/LAST_CHANGE
    for /f "tokens=*" %%a in ('.\res\getRemoteFileTextContent.exe %sUrl_Version%') do (set sVersionNumber=%%a)
    
    ::dynamic information init.
    set sReferrer="http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Win/%sVersionNumber%/"
    set sCookie="http://o-o.preferred.fra07t11.v8.cache8.c.bigcache.googleapis.com/chromium-browser-continuous/Win/%sVersionNumber%/mini_installer.exe?ms=tsu&mt=1340990464&cms_redirect=yes&redirect_counter=2"

    ::download execute
    wget "%sUrl_Protocol%://%sUrl_Base%/%sVersionNumber%/%sUrl_FileName%"                                                   ^
                                                                            --no-check-certificate                          ^
                                                                            --wait=2                                        ^
                                                                            --referer=%sReferrer%                           ^
                                                                            --timestamping                                  ^
                                                                            --debug                                         ^
                                                                            --continue                                      ^
                                                                            --no-cache                                      ^
                                                                            --no-cookies                                    ^
                                                                            --no-dns-cache                                  ^
                                                                            --server-response                               ^
                                                                            --auth-no-challenge                             ^
                                                                            --directory-prefix=.                            ^
                                                                            --header="Accept: application/octet-stream"     ^
                                                                            --header="Accept: application/x-msdos-program"  ^
                                                                            --header="Keep-Alive: 300"                      ^

endlocal

pause

to use the script you’ll need the small Execute or any other way of downloading and reading the content of the latest revision number (you can use “curl” compiled for windows, or something…)

and wGet (compiled for win32) placed in the same folder as the script or in the PATH.
download it here:
getRemoteFileTextContent.rar

p.s.

you can have all the new command-line switches for the newest latest version of chromium put in a text file and viewed by notepad++.
use the following CMD (batch) script:

@echo off
rem   set command-line arguments.
set sURL1=http://src.chromium.org/svn/trunk/src/chrome/common/chrome_switches.cc
set sURL2=http://src.chromium.org/svn/trunk/src/base/base_switches.cc
set sUserAgent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 GTBDFff GTB7.0 (.NET CLR 3.5.30729)"

set sFile=switches.cc

rem   remove old files.
if exist %sFile%   del /f /q %sFile%   >nul

rem   download.
wget --directory-prefix=. --user-agent=%sUserAgent% --output-document=%sFile% %sURL1% %sURL2%
rem ren %sFile% %sFile%_

start "D:\Software\Notepad++\Notepad++.exe" "%CD%\%sFile%"

you will need to modify the full url to Notepad++, or put its path in your PATH variable and just use “Notepad++.exe”, you will also need a wget compiled for win32 platform (or x64) just google it.

____—-____—-
March 2014: here is a working update:
it uses wGet, but you can also throw the link into any parallel download manager to speed things up a little, it uses a session cookie to fool the web-server a little bit..

::  browse
::  http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html
::  http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Win/
::  http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Win/
::  https://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Win/
::  https://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Win/144914/
::  for more information.


::static information init.
set sUserAgent="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; WOW64; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)"
set sUrl_Protocol=https
set sUrl_Base=commondatastorage.googleapis.com/chromium-browser-continuous/Win
set sUrl_FileName=mini_installer.exe
set sOrbitDownloaderExeFullPath=C:\Program Files (x86)\Orbitdownloader\orbitdm.exe


setlocal enableextensions
    :: sVersionNumber init.
    set sVersionNumber=""
    set sUrl_Version=http://commondatastorage.googleapis.com/chromium-browser-continuous/Win/LAST_CHANGE
    for /f "tokens=*" %%a in ('.\res\getRemoteFileTextContent.exe %sUrl_Version%') do (set sVersionNumber=%%a)
    
    ::dynamic information init.
    set sReferrer="http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Win/%sVersionNumber%/"
    set sCookie="http://o-o.preferred.fra07t11.v8.cache8.c.bigcache.googleapis.com/chromium-browser-continuous/Win/%sVersionNumber%/mini_installer.exe?ms=tsu&mt=1340990464&cms_redirect=yes&redirect_counter=2"

    set sURL=%sUrl_Protocol%://%sUrl_Base%/%sVersionNumber%/%sUrl_FileName%



    ::option #1.
    ::-------------------------------------------
    wget --no-check-certificate                          ^
         --wait=2                                        ^
         --referer=%sReferrer%                           ^
         --timestamping                                  ^
         --debug                                         ^
         --continue                                      ^
         --no-cache                                      ^
         --no-cookies                                    ^
         --no-dns-cache                                  ^
         --server-response                               ^
         --auth-no-challenge                             ^
         --directory-prefix=.                            ^
         --header="Accept: application/octet-stream"     ^
         --header="Accept: application/x-msdos-program"  ^
         --header="Keep-Alive: 300"                      ^
         "%sURL%"
    
    ::option #2.
    ::-------------------------------------------
    ::call "%sOrbitDownloaderExeFullPath%" "%sURL%"
    
endlocal