While running a batch file in Windows 7 with Admin rights from a thumb drive, how can I get the file path back to the thumb drive?

Posted by Jeremy DeStefano on Super User See other posts from Super User or by Jeremy DeStefano
Published on 2011-07-01T00:16:18Z Indexed on 2011/07/01 0:24 UTC
Read the original article Hit count: 542

I have a piece of software that is being distributed to several departments for installation onto Windows 7 laptops. They install software from the thumb drive and then they have to run a script to properly configure the software.

Because the script is changing registry files and program files, it requires Admin rights. When running as Admin, it drops into the System32 folder and I no longer have an easy scriptable way to access files that need to be copied from the thumb drive, simply because I don't know for sure what drive letter its going to use on the various machines. Previous installations were on Windows XP and the command window file path stayed within the script folder.

I've found similar questions here and I have already tried Relative Paths, but it can't seem to find the proper folder on the thumb drive or I can't seem to find the proper way to format it.

© Super User or respective owner

Related posts about windows-7

Related posts about Windows