Your code need to change the row to:
Code: Select all
...
findstr /v "^Total" < "%name%" >"X:\FOLDER\%dd%%mm%%yyyy:~2%Q.txt"
...
The letter
X: is the USB drive (USB pen) and
FOLDER is the path at this drive.
The letter of the USB drive is not anytime the same letter. Possible is this problem when you have more as one USB drive.
How can make a folder see
MD /? or
MKDIR /?.
And here a solution to find the USB drive.
FindUSB.batCode: Select all
@ECHO OFF
setlocal enableextensions
set "drlist="
for /f "tokens=*" %%A in ('fsutil fsinfo drives^|find /V ""') do (
set "dr=%%A"
call set "drlist=%%drlist%% %%dr:~-3%%"
)
set "USBdrive="
for %%A in (%drlist%) do for /f %%D in ('mountvol %%A /l') do (
if "%%D" equ "\\?\Volume{332abe1e-c139-11dd-a897-000ae44fc4a7}\" set USBdrive=%%A
)
echo USB drive: %USBdrive%
You need to change the volume name to your USB drive (USB pen).
Please copy this following batch to the USB drive.
The same USB drive have not the same mount volume at different computers.
USB-Test.batCode: Select all
@echo off
set var=%~d0
for /f %%a in ('mountvol %var% /l') do set mvol=%%a
echo ComputerName: %computername%
echo LogonServer: %logonserver%
echo UserDomain: %userdomain%
echo current drive: %var%
echo MountVolumen: %mvol%
::
echo ComputerName: %computername%>>USB-Info.txt
echo LogonServer: %logonserver%>>USB-Info.txt
echo UserDomain: %userdomain%>>USB-Info.txt
echo current drive: %var%>>USB-Info.txt
echo MountVolumen: %mvol%>>USB-Info.txt
echo.>>USB-Info.txt
echo.
pause