lundi 28 juillet 2008

Shortcuts

go.cmd:
@echo off
if .==.%1 goto aide
if /i %1==-e start e c:\bin\go.cmd & goto fin
if /i %1==bureau cd /d "%userprofile%\Bureau" & goto fin
if /i %1==appdata cd /d "%userprofile%\Application Data" & goto fin
if /i %1==settings cd /d "%userprofile%\Local settings" & goto fin
if /i %1==dl cd /d c:\Downloads & goto fin
if /i %1==pub cd /d c:\ftproot & goto fin
if /i %1==incoming cd /d c:\ftproot\incoming & goto fin
echo Token inconnu
goto fin
:aide
echo go emplacement
echo avec emplacement parmi bureau appdata settings dl pub incoming
:fin

zip / unzip en une touche

z.cmd:
@zip -m9 %1.zip %1


u.cmd:
@unzip -o %1
@if not errorlevel 2 del %1


nota:
. le errorlevel est 1 si TZ n'est pas fixée
. évidemment, les jokers ne sont pas gérés

z foo.txt
produit foo.txt.zip & supprime foo.txt

u foo.txt.zip
produit foo.txt & supprime foo.txt.zip