WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

File Operations

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Get Users Home Directory

 Keywords:  User Profile Directory Folder Temp Environment USERPROFILE ShortCutDir

Question:

I can't seem to find the function which would tell me what the persons home directory is when running a winbatch script. i.e. c:\users\\My Documents. I've been away for a while, and my debug scripts used to just write to c:\temp, but I'm thinking those days are far behind me now!

Answer:

Take your pick.
strProfile = Environment("USERPROFILE")
strTemp = Environment("TEMP")
strDocuments = ShortCutDir("{FDD39AD0-238F-46AF-ADB4-6C85480369C7}")

Article ID:   W17875
Filename:   Get Users Home Directory.txt
File Created: 2013:09:13:07:59:32
Last Updated: 2013:09:13:07:59:32