0
I have a batch script that I use when I set up new Windows 7 PCs that creates a user based on a variable, creates a folder on their desktop, then shares it:
@echo off
SET /p unitnumber="Enter unit number: "
net user unit%unitnumber% password /add /expire:never
MD "C:/Users/unit%unitnumber%/Desktop/Accounting #%unitnumber%"
runas /user:administrator "net share "Accounting#%unitnumber%"="C:/Users/unit%unitnumber%/Desktop/Accounting#%unitnumber""
I discovered that the share that is created is overwritten when the newly created user first logs on, because Windows creates builds their profile directory at that time.
Is there any way to initiate a build of a user's profile directory in the batch file just after creating the it? The only thing that looks useful is the /homedir:pathname
switch for the net user
command, but I believe that option assumes the directory already exists.
I'd be willing to use whatever to get this done as long as I can incorporate/launch it from the batch.
Any suggestions?
You're right, just watched my Windows installation from linux and didn't recognis that there are multiple symlinks to the directory. On my installation I got
Documents and Settings
andDokumente und Einstellungen
as it is called on a german installation. AndDefault User
is a symlink toDefault
. Just an old habbit from Windows XP times... – noggerl – 2013-10-21T22:27:44.270