20210113: attention mise en page chaotique à cause de % % !
extrait de de
ZimbraExport2ThunderbirdJournal2018
PAS TESTE, SANS DOUTE DES BUG CACHES!
fichier dodel.vbs
fichier compact.bat
if not x%4x xx goto deux
if x%1x
xx goto doc
if x%2x xx goto unseul
echo debut execution un fichier = = = = = =%1%2
%3
pause
if exist %1 goto onyva
echo >>%2.bug.txt PAS exist = = =%1= = =
pause
goto fin
:onyva
dir %1
if errorlevel 1 goto er1
echo pas d'erreur
goto ok
:er1
rem fichier inaccessible = = = =%1= = = = =
echo >>%2.bug.txt PAS DIR %1
rem pause
goto fin
:ok
rem en OK
time <nul
echo From - Sun dec 16 10:35:23 2018 >> %3
echo X-Pof forged by http://antiguide.free.fr/wiki/wakka.php?wiki=ZimbraExport2Thunderbird %3 >> %3
echo X-Pof %1 >> %3
type %1 >> %3
echo >>%2.Ok.txt ok DIR = = =%1= = =
echo dir %1 | find /i "ichier(s)" >>%2.Ok.txt
del %1
rem pause
goto fin
:deux
if not x%2x
x!x goto x2plein
rem ici %2 ! dossier sent
echo >>%1.Ok.txt dossier(b) = = =%1= = = =
echo >>%1.bug.txt dossier(c) = = =%1= = = =
foto x2fait
:x2plein
echo >>%1.Ok.txt dossier(d) = = =%1%2= = = =
echo >>%1.bug.txt dossier(e) = = =%1%2= = = =
:x2fait
rem ici DEUX pour un dossier
echo -(0)-%1-%2-un dossier
rem pause
rem vaudrait mieux effacer un a un
if x%2x
x!x del %1\*.meta
if not x%2x x!x del %1%2\*.meta
echo -(3)-%1-%2-
rem pause
rem ici si
f contient un % il faut le doubler
if x%2x == x!x for
f in (%1\*.eml) do cscript check.vbs "
f in (%1\*.eml) do call compact.bat "
f" %1 %1.tb
if not x%2x == x!x for
f in (%1%2\*.eml) do call compact.bat "
f" %1 %1.tb
rem et si il reste des .eml dnas dossier ou des sous dossiers
if x%2x == x!x goto single
echo cherche sous rep dans %1%2 >> %1.ok.txt
rem 0700 ne pas bouger les intouchables!
rem xcopy %1%2\*.eml %1\.
rem for
f in (%1\*.eml) do call compact.bat "
f" %1 %1.tb
:single
echo --(1)-%1-%2-
rem vérifier si il reste dans racine
echo verifier sousrep de %1%2 vide >>%1.bug.txt
if x%2x == x!x goto prem
rem del /Q %1%2\*.*
dir /b /s %1%2
dir /b /s %1%2 >>%1.bug.txt
rem et ne pas les effacer
rem A VOIR del /Q %1\*.*
goto ouf
:prem
rem del /Q %1\*.*
dir /b /s %1
dir /b /s %1 >>%1.bug.txt
rem et ne pas les effacer
rem A VOIR del /Q %1%2\*.*
goto ouf
:ouf
rem pause
goto fin
:unseul
rem une seule fois pour la racine
echo >> %1.ok.txt andiamo
date <nul >> %1.ok.txt
time <nul >> %1.ok.txt
cd >> %1.ok.txt
echo >> %1.bug.txt andiamo
date <nul >> %1.bug.txt
time <nul >> %1.bug.txt
cd >> %1.bug.txt
call compact.bat %1 ! . .
pour les dix premiers dossiers
for
f in (1 2 3 4 5 6 7 8 9 ) do call compact.bat %1 !
u in (1 2 3 4 5 6 7 8 9) do for
f in (0 1 2 3 4 5 6 7 8 9 ) do call compact.bat %1 !
u
f . .
goto fin
:doc
echo appel: rapaille dossier
echo depuis le dossier contyeant les dossiers !*
:fin
echo on est en fin!
rem pause
##
fichier pctpct.vbs: (double tout % dans nom de fichiers?)
option explicit
dim oFs
set oFs=createobject("scripting.filesystemobject")
explore "."
sub explore (niveau)
dim unfo
set unfo=ofs.getfolder(niveau)
dim file
for each file in unfo.files
dim ori,nxt
ori=file.name
if not ofs.fileexists (ori) then msgbox "bug!"
dim i
nxt=
for i=1 to len(ori)
nxt=nxt&mid(ori,i,1)
if mid(ori,i,1)="%" then nxt=nxt&"%"
next
if ori<>nxt then
msgbox ori & vbcrlf & nxt
ofs.movefile nxt , "jojo"
end if
next
dim subfolder
For Each Subfolder in unfo.SubFolders
' Wscript.Echo Subfolder.Path
if mid(subfolder.name,1,1)="'" then msgbox "gaffe" & vbcrlf & subfolder.name
explore Subfolder
next
end sub%%
fichier check.vbs:
%%option explicit
on error goto 0
dim oFs
set oFs=createobject("scripting.filesystemobject")
dim ori,nxt,i
ori= wscript.arguments(0)
if instr(ori,"%")=0 then wscript.quit
for i=1 to len(ori)
' nxt=nxt&mid(ori,i,1)
if mid(ori,i,1)<>"%" then nxt=nxt&mid(ori,i,1)
next
if ori<>nxt then
msgbox ori & vbcrlf & nxt
ofs.movefile ori , nxt
end if%%
fichier ultime
##
echo debut execution = = = = = = 1:%1= = =2:%2= = =3:%3= = = =
rem pause
if not x%4x == xx goto deux
if x%1x == xx goto doc
if x%2x == xx goto unseul
if exist %1 goto onyva
echo >>%2.bug.txt PAS exist ===%1===
rem pause
goto fin
:onyva
dir %1
if errorlevel 1 goto er1
echo pas d'erreur
goto ok
:er1
rem fichier inaccessible = = = =%1= = = = =
rem
echo >>%2.bug.txt PAS DIR ===%1===
rem pause
goto fin
:ok
rem en OK
time <nul
echo From - Sun dec 16 10:35:23 2018 >> %3
echo X-Pof-by: http://antiguide.free.fr/wiki/wakka.php?wiki=ZimbraExport2Thunderbird %3 >> %3
echo X-Pof-file: %1 >> %3
type %1 >> %3
echo >>%2.Ok.txt ok DIR ===%1===
echo dir %1 | find /i "ichier(s)" >>%2.Ok.txt
del %1
rem pause
goto fin
:deux
if not x%2x
x!x goto x2plein
rem ici %2 ! dossier sent
echo >>%1.Ok.txt dossier(b) = = =%1= = = =
echo >>%1.bug.txt dossier(c) = = =%1= = = =
goto x2fait
:x2plein
echo >>%1.Ok.txt dossier(d) = = =%1%2= = = =
echo >>%1.bug.txt dossier(e) = = =%1%2= == =
:x2fait
rem ici DEUX pour un dossier
echo -(0)-%1-%2-un dossier
rem pause
rem vaudrait mieux effacer un a un
if x%2x
x!x del %1\*.meta
if not x%2x x!x del %1%2\*.meta
echo -(3)-%1-%2-
rem pause
rem inventer une manière de publier % %
rem entre double guil
"" ça va?
rem non
if x%2x ""=="" x!x echo - - - - - - racine
if x%2x ""=="" x!x for ""
f in (%1\*.eml) do cscript /nologo check.vbs "
f""" >> %1.check.txt
if x%2x ""=="" x!x for ""
f in (%1\*.eml) do call compact.bat "
f""" %1 %1.tb
if x%2x ""=="" x!x for ""
f in (%1%2\*.eml) do cscript /nologo dodel.vbs "
f""" >> %1.dodel.txt
if not x%2x ""=="" x!x echo - - - - - - - autre
if not x%2x ""=="" x!x for ""
f in (%1%2\*.eml) do cscript /nologo check.vbs "
f""" >> %1.check.txt
if not x%2x ""=="" x!x for ""
f in (%1%2\*.eml) do call compact.bat "
f""" %1 %1.tb
if not x%2x ""=="" x!x for ""
f in (%1%2\*.eml) do cscript /nologo dodel.vbs "
f""" >> %1.dodel.txt
rem pause
rem et si il reste des .eml dnas dossier ou des sous dossiers
if x%2x ""=="" x!x goto single
echo cherche sous rep dans %1%2 >> %1.ok.txt
rem 0700 ne pas bouger les intouchables!
rem xcopy %1%2\*.eml %1\.
rem for ""
f in (%1\*.eml) do call compact.bat "
""f" %1 %1.tb
:single
echo -(1)-%1-%2-
rem vérifier si il reste dans racine
echo verifier sousrep de %1%2 vide >>%1.bug.txt
if x%2x == x!x goto prem
rem del /Q %1%2\*.*
dir /b /s %1%2
dir /b /s %1%2 >>%1.bug.txt
rem et ne pas les effacer
rem A VOIR del /Q %1\*.*
goto ouf
:prem
rem del /Q %1\*.*
dir /b /s %1
dir /b /s %1 >>%1.bug.txt
rem et ne pas les effacer
rem A VOIR del /Q %1%2\*.*
goto ouf
:ouf
rem pause
goto fin
:unseul
rem une seule fois pour la racine
echo >> %1.ok.txt andiamo
date <nul >> %1.ok.txt
echo . >> %1.ok.txt
time <nul >> %1.ok.txt
echo . >> %1.ok.txt
cd >> %1.ok.txt
echo >> %1.bug.txt andiamo
date <nul >> %1.bug.txt
time <nul >> %1.bug.txt
cd >> %1.bug.txt
call compact.bat %1 ! . .
pour les dix premiers dossiers
for ""
f in (1 2 3 4 5 6 7 8 9 ) do call compact.bat %1 !
u in (1 2 3 4 5 6 7 8 9) do for
f"" in (0 1 2 3 4 5 6 7 8 9 ) do if not exist %1!""
u
f"" goto fin
goto fin
:doc
echo appel: rapaille dossier
echo depuis le dossier contyeant les dossiers !*
:fin
echo on est en fin!
rem pause
##
Ouf!
compact.bat
##if not x%4x == xx goto deux
if x%1x == xx goto doc
if x%2x == xx goto unseul
echo debut execution un fichier ===================================%1===%2===%3====
pause
if exist %1 goto onyva
echo >>%2.bug.txt PAS exist ===%1===
pause
goto fin
:onyva
dir %1
if errorlevel 1 goto er1
echo pas d'erreur
goto ok
:er1
rem fichier inaccessible ====%1=====
echo >>%2.bug.txt PAS DIR ===%1===
rem pause
goto fin
:ok
rem en OK
time <nul
echo From - Sun dec 16 10:35:23 2018 >> %3
echo X-Pof forged by http://antiguide.free.fr/wiki/wakka.php?wiki=ZimbraExport2Thunderbird %3 >> %3
echo X-Pof %1 >> %3
type %1 >> %3
echo >>%2.Ok.txt ok DIR ===%1===
echo dir %1 | find /i "ichier(s)" >>%2.Ok.txt
del %1
rem pause
goto fin
:deux
if not x%2x == x!x goto x2plein
rem ici %2 == ! dossier sent
echo >>%1.Ok.txt dossier(b) ===%1====
echo >>%1.bug.txt dossier(c) ===%1====
foto x2fait
:x2plein
echo >>%1.Ok.txt dossier(d) ===%1%2====
echo >>%1.bug.txt dossier(e) ===%1%2====
:x2fait
rem ici DEUX pour un dossier
echo --(0)---%1-----%2-----un dossier
rem pause
rem vaudrait mieux effacer un a un
if x%2x == x!x del %1\*.meta
if not x%2x == x!x del %1%2\*.meta
echo --(3)---%1-----%2------
rem pause
rem ici si
f contient un % il faut le doubler
if x%2x
x!x for
f in (%1\*.eml) do cscript check.vbs "
f"
if x%2x x!x for
f in (%1\*.eml) do call compact.bat "
f" %1 %1.tb
if not x%2x
x!x for
f in (%1%2\*.eml) do call compact.bat "
f" %1 %1.tb
rem et si il reste des .eml dnas dossier ou des sous dossiers
if x%2x x!x goto single
echo cherche sous rep dans %1%2 >> %1.ok.txt
rem 0700 ne pas bouger les intouchables!
rem xcopy %1%2\*.eml %1\.
rem for
f in (%1\*.eml) do call compact.bat "
f" %1 %1.tb
:single
echo --(1)
%1
%2
rem vérifier si il reste dans racine
echo verifier sousrep de %1%2 vide >>%1.bug.txt
if x%2x
x!x goto prem
rem del /Q %1%2\*.*
dir /b /s %1%2
dir /b /s %1%2 >>%1.bug.txt
rem et ne pas les effacer
rem A VOIR del /Q %1\*.*
goto ouf
:prem
rem del /Q %1\*.*
dir /b /s %1
dir /b /s %1 >>%1.bug.txt
rem et ne pas les effacer
rem A VOIR del /Q %1%2\*.*
goto ouf
:ouf
rem pause
goto fin
:unseul
rem une seule fois pour la racine
echo >> %1.ok.txt andiamo
date <nul >> %1.ok.txt
time <nul >> %1.ok.txt
cd >> %1.ok.txt
echo >> %1.bug.txt andiamo
date <nul >> %1.bug.txt
time <nul >> %1.bug.txt
cd >> %1.bug.txt
call compact.bat %1 ! . .
pour les dix premiers dossiers
for
f in (1 2 3 4 5 6 7 8 9 ) do call compact.bat %1 !
f . .
for
u in (1 2 3 4 5 6 7 8 9) do for
f in (0 1 2 3 4 5 6 7 8 9 ) do call compact.bat %1 !
f . .
goto fin
:doc
echo appel: rapaille dossier
echo depuis le dossier contyeant les dossiers !*
:fin
echo on est en fin!
rem pause