|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Nov 2000
Messaggi: 354
|
Aiuto con batch per elenco cartelle e file
CIao a tutti, vorrei creare un file batch con le seguenti caratteristiche:
Secondo voi è fattibile con un semplice file bat? Ho provato con il comando dir con gli attributi /A/S/B e mi sembra possa andare, ma so farlo solo con un disco alla volta e invece vorrei fare i dischi in sequenza generando un unico file di output. Mi date una mano per favore?? Grazie mille |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: May 2005
Messaggi: 8697
|
Codice:
@ECHO OFF
ECHO Report > Output.txt
ECHO. >> Output.txt
Setlocal EnableDelayedExpansion
WMIC logicaldisk where drivetype=3 get caption>%~n0.tmp
FOR /f "tokens=1-3 skip=1" %%a in ('type "%~n0.tmp"') do call :Info %%a
DEL "%~n0.tmp"
goto :END
:Info
Set Drive=%1
ECHO DRIVE %Drive%
ECHO INIZIO DIR
DIR /A/B/S %Drive%\ >> Output.txt
ECHO FINE DIR
ECHO.
ECHO. >> Output.txt
goto :EOF
:END
ECHO Operazione terminata
PAUSE
__________________
. Thread Ufficiali: EasyCrypt ~ Old Files Manager ~ OSD Clock The real me is no match for the legend . Ultima modifica di x_Master_x : 24-01-2016 alle 19:58. |
|
|
|
|
|
#3 |
|
Senior Member
Iscritto dal: Nov 2000
Messaggi: 354
|
Grazie mille!!
Grazie ancora! Ultima modifica di vidario : 24-01-2016 alle 20:00. |
|
|
|
|
|
#4 |
|
Senior Member
Iscritto dal: May 2005
Messaggi: 8697
|
Non si quotano i post con i codici, edita per cortesia. Una cosa del genere:
Codice:
:Info Set Drive=%1 Set True=0 If %Drive%==X: ( Set True=1 ) If %Drive%==Y: ( Set True=1 ) If %True%==1 ( ECHO DRIVE %Drive% ECHO INIZIO DIR etc. )
__________________
. Thread Ufficiali: EasyCrypt ~ Old Files Manager ~ OSD Clock The real me is no match for the legend . |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 21:15.



















