Page 1 of 1

How to get pass username.

Posted: 06 May 2009 09:50
by SuddenG
Hi there guys,

I'm currently trying you use this line of code which works fine:
"%SystemRoot%\explorer.exe "C:\Program Files\Steam\Steamapps"

But after \steamapps there is a username which differs from computer to computer. I need to get past that in-order to open up another file.

Could you tell me how to make it open all usernames or %Username% or something.

Thanks.

Posted: 07 May 2009 19:44
by avery_larry
UNTESTED

Code: Select all

for /f "usebackq tokens=*" %%a in (`dir /ad /b "C:\Program Files\Steam\Steamapps"`) do (
   "%SystemRoot%\explorer.exe" "C:\Program Files\Steam\Steamapps\%%a\yourfile.txt"
)