1.

Solve : Need batch file to look in correct user folder?

Answer»

Hi! I have a batch file that uses an input file located in the user's Documents and SETTINGS directory (C:\Documents and Settings\username\...file.txt).

How do I get the batch file to look in the correct user's Documents and Settings folder? That is, if person A is logged in, the batch file should look in C:\Documents and Settings\person_a\...file.txt and if person B i logged in it should look in C:\Documents and Settings\person_b\...file.txt etc.

Can anyone help me on this?

Thank you!
/Karenhey
if you use %username% in place of person_A , that will work..

C:\docume~1\%username%\..file.txtA better variable might be "%userprofile%" which displays the current user's PROFILE folder regardless of OS. For example VISTA uses 'Users'.

Quote

C:\>echo %userprofile%
C:\Users\DeltaSlaya

C:\>
Perfect! Thank you both!!


Discussion

No Comment Found