Paul Stoffregen Posted July 13, 2010 Posted July 13, 2010 This is probably a silly question, but honestly I almost never use Windows, soooo... I'm working on a new example application that will make use of the USB disk feature in 0.9, and demonstrate a number of more advanced I/O concepts. I wrote a little application and compiled it to a .EXE, which will be stored on the USB disk. The EXE works. That was the easy part (actually, I wrote and tested it in Linux, then ported to Windows) So, the main question is how do I figure out the drive letter that Windows assigns, so I can run it at the command prompt? Or is the some way to run it without knowing the drive letter? Specifically, the device is plugged in. The HID keyboard types Win-R, then "CMD". Then I wait a bit for Windows to detect the disk. If I knew the drive letter in advance, I could just have the keyboard type something like "E:\MYTEST.EXE" to run it. But I don't know if the drive letter will be E:, F:, G: or whatever. Any ideas? I'm sure this is probably very obvious to you folks who know Windows so well. Quote
Netshroud Posted July 13, 2010 Posted July 13, 2010 (edited) for /F %a in ('WMIC logicaldisk list brief ^| find "VOLLABEL"') do %a\mytest.exe Replace VOLLABEL with the flash drive's volume label Edited July 13, 2010 by Psychosis Quote
Paul Stoffregen Posted July 13, 2010 Author Posted July 13, 2010 for /F %a in ('WMIC logicaldisk list brief ^| find "VOLLABEL"') do %a\mytest.exe Replace VOLLABEL with the flash drive's volume label Awesome, thanks! Works great. :) I had to add the ability to assign a volume label when using the internal memory for USB disk. I guess now I should probably add info about that to the auto-generated readme file and upload a new Teensyduino.... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.