Folder redirect using VBS

J

Jeremy Dillinger

Is there a way to write a vbs script that would remap the documents folder
to a network share (Like you are able to do through GPO)

I am looking for a way to do this after first running a batch script to map
a drive. The network share would need to be authenticated with first before
the documents can be mapped to it. Currently with the GPO the remap tries to
take place before the authentication therby failing with the redirect.

Any help would be appreciated. Thanks

Jeremy Dillinger
 
M

Mark Heitbrink [MVP]

Hi,

Jeremy said:
Is there a way to write a vbs script that would remap the documents folder
to a network share (Like you are able to do through GPO)

You have to manipulate
HKCU\Software\Microsoft\Windows\Current Version\Explorer
User Shell Folders, but(!):
The redirect has to be done, at time the profile loads, because
otherwise the entry will point to a place but the profile
(ntuser.dat) is already loaded and it has no efect.

I don´t know if it works if you set "Run Scripts synchronously"
in computer configuration. Your chance with this option is,
the explorer.exe loads after runnig all sripts.

Mark
 
G

Guest

Hi,

You need to modify the HKCU\Software\Microsoft\Windows\Current
Version\Explorer\User Shell Folders

You can do this by running a VBScript or a Reg file to modify the path on
logon. It wouldn't take affect until the second logon though.

I have mandatory profiles so I just "Load Hive" and modify them manually
first.

Cheers,
Lara
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top