Prob création fichier Bat Vaccin support USB

Résolu/Fermé
hossec Messages postés 426 Date d'inscription lundi 14 janvier 2008 Statut Membre Dernière intervention 23 septembre 2013 - 6 janv. 2011 à 21:36
hossec Messages postés 426 Date d'inscription lundi 14 janvier 2008 Statut Membre Dernière intervention 23 septembre 2013 - 8 janv. 2011 à 10:45
Bonsoir à tous,

J'ai récupéré un tuto ici :

http://www.zebulon.fr/dossiers/128-15-vaccination-noms-reserves-windows.html

Il est destiné à la création d'un fichier bat pour créer un vaccin autorun.inf avec des noms réservé de Windows. Jusque là pas de problème (Il me semble par ailleurs que le sujet est ancien)
Le problème qui réside dans mon bat est qu'il ne créé qu'un seul dossier. L'auteur précise l'ajoute de lignes pour la création de plusieurs dossiers mais ça ne fonctionne pas. Voici ce qu'il préconise:

:nomrep
echo autorun.inf > %temp%\nomrep.txt
echo Nom_du_répertoire_supplémentaire_1 > %temp%\nomrep.txt
echo Nom_du_répertoire_supplémentaire_2 > %temp%\nomrep.txt
echo Nom_du_répertoire_supplémentaire_3 > %temp%\nomrep.txt
goto vaccon

Voici mon bat

chcp 1252
@echo off
del /q %temp%\rapportVacUSB.txt
echo %date% - %time% - Vaccin USB - Gof>%temp%\rapportVacUSB.txt
echo. >>%temp%\rapportVacUSB.txt
goto lecteur
:vaccon
echo Répertoires et fichiers vaccins :>>%temp%\rapportVacUSB.txt
echo. >>%temp%\rapportVacUSB.txt
FOR /f %%g in (%temp%\lecteur.txt) do for /f %%h in (%temp%\nomrep.txt) do (
if exist "%%g\%%h" echo %%g\%%h Present >> %temp%\rapportVacUSB.txt
if exist "%%g\%%h" attrib.exe -h -r -s -a "%%g\%%h"
if exist "%%g\%%h" del /q "%%g\%%h"
rd /s /q "%%g\%%h"
md "%%g\%%h"
type nul > "\?\%%g\%%h\con.Repertoire vaccin"
if exist "\?\%%g\%%h\con.Repertoire vaccin" echo %%g\%%h - Vaccin Ok >> %temp%\rapportVacUSB.txt
attrib.exe +h +r +s +a "%%g\%%h"
)
goto sortie
:sortie
echo.>> %temp%\rapportVacUSB.txt
echo %date% - %time% : Fin.>> %temp%\rapportVacUSB.txt
start %temp%\rapportVacUSB.txt
exit
:lecteur
del /q %temp%\lecteur.txt
echo Lecteur détectés :>>%temp%\rapportVacUSB.txt
echo. >>%temp%\rapportVacUSB.txt
for %%i in (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, y, y, z) do (
vol %%i:
if not errorlevel 1 echo %%i: >>%temp%\lecteur.txt
vol %%i:
if not errorlevel 1 vol %%i: >>%temp%\rapportVacUSB.txt
)
echo. >>%temp%\rapportVacUSB.txt
goto nomrep
:nomrep
echo driver > %temp%\nomrep.txt
echo myfolder > %temp%\nomrep.txt
echo autorun.inf > %temp%\nomrep.txt
goto vaccon

IL NE ME CREE QUE LE DOSSIER AUTORUN MAIS PAS LES AUTRES

PS: j'espère ne pas mettre trompé de forum

Hossec
A voir également:

1 réponse

hossec Messages postés 426 Date d'inscription lundi 14 janvier 2008 Statut Membre Dernière intervention 23 septembre 2013 59
8 janv. 2011 à 10:45
Salut,

J'ai eu la réponse sur un autre Forum
Pour ceux que ça intéresse voici l'adresse de la réponse

https://codes-sources.commentcamarche.net/#2

Merci à vous tous

Hossec
0