lundi 9 mars 2020

How do I exclude something in a .txt from showing up with For?

I made the following script for displaying all the local users that don't have a nominative folder in the destination.

I'd like to create an exlusion text file for the users that I don't want to display.

I'm note really sure how I can achieve this.

Here is my code:

@echo off

set BackupDest=D:\backup

echo Destination folder missing for the following user(s):
for /D %%I in ("%HomeDrive%\users\*") do if not exist "%BackupDest%\%%~nI\" (
echo %%~nI
)

Aucun commentaire:

Enregistrer un commentaire