1

I am currently using a program called USBDeviewer for auditing purposes. Basically what it does is it gets a list of USB devices that were used on a particular PC. The program can create a log file but you have to do it manually. The keyboard command to save a log file is ctrl+A to select all devices and then ctrl+S to save. After you select save you are prompted to enter a filename and location to save it.

I need a batch script that will automatically run this program and save the information on the log file to a folder automatically without any human intervention such as typing in the name (it needs a different name every time, perhaps the filename can include a different date every time).

This is a simple script but I am not familiar with batch scripting so any help would be appreciated.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Brian
  • 11
  • 2
  • 1
    Via its command line `usbdeview.exe /stext c:\temp\thefile.txt` – Alex K. Jun 23 '15 at 12:55
  • See this for date/time file name: [Batch command date and time in file name](http://stackoverflow.com/questions/7727114/batch-command-date-and-time-in-file-name) – Alex K. Jun 23 '15 at 12:56

1 Answers1

0

Save Command-Line Options for usbdeview.exe

/stext Filename : Save the list of all USB devices into a regular text file.

@echo off
set Log=c:\temp\logfile.txt
usbdeview.exe /stext %Log%
Hackoo
  • 18,337
  • 3
  • 40
  • 70