One of the items I had to do a bit of digging to find was the location of the startup folder for all users.
If you aren’t familiar with the “startup” folder on your system I will explain it briefly.
The startup folder is a place you can put executable files (.exe), batch files (.bat), etc. that you want Windows to run every time a user logs into the system. There are a lot of usage scenarios for such a folder, my specific use case is mapping a remote windows share as a drive, for which I use a batch file.
For those of you who are curious, my batch file code is simply this:
net use X: \\126.96.36.199\ShareName /user:domain\username p@ssW0rd /persistent:no
This would mount a share called “ShareName” from a server at (fictional) ip address 188.8.131.52 as the X: drive. I save that code in a text file and change the extension to .bat, drop it in one of the startup folder locations I will show below and voila, my share is mounted every time I login.
If you are coming from the Linux world you can think of it like one of the cron folders common to linux except that rather than executing its contents on a schedule it executes them whenever a user logs in.
For personal use it was easy enough to find:
The location above will execute scripts for a single user every time that user logs in. As a system admin though often times I need scripts to execute for ALL users on a given system. That is what the common startup folder is for. I had to do a bit of Googling to find the location for the Common Startup folder. Eventually I found what I was looking for though, on Server 2012 R2 it is located here:
There are a couple of commands you can run from the start menu search field to quickly get these locations and I am hoping they keep these commands consistent across Windows versions. I can confirm that both of these commands work just fine of Sever 2008 R2.
To find the logged-in user’s startup folder:
To find the common user’s startup folder:
That’s it. I just wanted to document this for my own personal use as I often end up scouring the internet for information I have looked up previously but forgotten.