Yes! Grazie mille, sta sera provo a farlo funzionare :)ho trovato: https://support.microsoft.com/en-us/kb/65994
spiega che é possibile usando a funzione IF EXIST
il piccolo batch qua sopra verifica l´esistenza della cartella con path C:\Users\. Si aggiunge NUL come spiegato nel link sopra.Codice:@[URL="http://www.tomshw.it/forum/members/echo-5197.html"]echo[/URL] off IF EXIST C:\Users\NUL ( echo "path found!" CD \Users\ ) ELSE ( echo "path not found..." )
puoi usare questo codice per la verifica di tutte i path che si possono creare.
un ciclo esterno che ti cicla tutte le lettere da D a Z e un if dentro al ciclo che ti permette di verificare se esiste il path
una cosa del genere
Codice:@[URL="http://www.tomshw.it/forum/members/echo-5197.html"]echo[/URL] off :infinite for %%a in ( D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) DO ( IF EXIST %%a:\NUL ( //fai cose ) goto infinite
- - - Updated - - -
ti riporto anche una interessante discussione presa da StackOverflow, la prima risposta, dopo EDIT mi sembra faccia al caso tuo!
Detect USB and copy *.* to USB drive using batch script - Stack Overflow