Skip navigation

Batch Script Not Only Enumerates User Profiles But Also Shows How to Error-Proof Paths

GetUserProfiles.bat uses the NetUsers tool to enumerate user profiles on PCs. This list of user profiles can be helpful, especially if you need to clean up old user profiles on shared PCs or locate all the PCs a specific user has logged on to for security reasons. Even if you don't need to enumerate user profiles, GetUserProfiles.bat is valuable in that it demonstrates how to error-proof paths. Script errors are often caused by problems with pathnames to input, output, and utility files.

To learn how to error-proof paths and download GetUserProfiles.bat, read Dick Lewis' article "Learn How to Error-Proof Paths and Creatively Manipulate Strings." I've opened up this article for public viewing through March 6. If you enjoy reading this article, you can get more of this type of content by subscribing to Scripting Pro VIP.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish