Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

W2K Pro Folder Redirection

Posted on 2002-05-08
7
Medium Priority
?
635 Views
Last Modified: 2010-04-13
Hey, all...

I know that it is possible to set a group policy for folder redirection on a domain, but what about as a local policy?

My W2KP box is part of an internal p-2-p network, and I'm trying to implement folder redirection to keep files, foldes & apps off the drive that contains the sys files.

Would like to set folder redirection for MyDocs to a seperate volume for each of 4 users (I know I can setup HomeDir, but that is in *addition* to MyDocs & does not redirect, to my understanding)... also have temp & tempInternet folders redirected to T: volume.

Any help would be appreciated... working on it tonight.

Regards,
/ew
0
Comment
Question by:EricWestbo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 3

Expert Comment

by:Corvax021899
ID: 6997953
Do it with a script that you add at user startup, in the allusers startup or personal startup!
Here is a sample:
------------------


'Initialize the Shell Object
Dim wshShell
Set wshShell = WScript.CreateObject("Wscript.Shell")
'Network Object
Dim wshNet
Set wshNet = WScript.CreateObject("Wscript.Network")

'File Sytem Object
Dim fso
Set fso = WScript.CreateObject("Scripting.FileSystemObject")


'Vars for MyDocs And Temp
Dim MyDocsPath
Dim TempPath

'Set the values wanted
MyDocsPath = "T:\" & wshNet.UserName & "\My Documents"
TempPath =  "T:\" & wshNet.UserName & "\Temp"

'Verifie if folder exists, if not then the folder must be created
'And regestry updated.
'Note: The Effects will Only take Place at next Logon.
'I Could force a logoff if you want...

If fso.FolderExists(TempPath) = False Then
     fso.CreateFolder TempPath
     'Write to the Regestry
     wshShell.RegWrite "HKEY_CURRENT_USER\Environment\TEMP",TempPath,"REG_SZ"
     wshShell.RegWrite "HKEY_CURRENT_USER\Environment\TMP",TempPath,"REG_SZ"
End If

If fso.FolderExists(MyDocsPath)= False Then
     fso.CreateFolder MyDocsPath
     'Write to the Regestry
     wshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal",MyDocsPath,"REG_EXPAND_SZ"
     wshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Personal",MyDocsPath,"REG_EXPAND_SZ"
End if

0
 
LVL 4

Author Comment

by:EricWestbo
ID: 6997963
Corvax,

Not a big scripter, to be honest, but can probably dance my way around the variables, etc.

How would I save this to disk?  ie: what kind of extension?  is this a .vbs?

Going to give it a try in a bit & will post results.

/ew
0
 
LVL 4

Author Comment

by:EricWestbo
ID: 6997974
Just a follow-up Q: I see the variable for MyDocs & Temp... what about Temporary Internet Files?  Is there a specific variable to use?

/ew
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 3

Expert Comment

by:Corvax021899
ID: 6997975
Yes it is a .vbs, just open notepade and save it in there and rename it after...

If you copy past this, there is one problem.

the 2 lines for the Mydocs.  They are split in two lines, you will have to put them ont the same so that line that goes like this:
Folder\Personal",MyDocsPath,"REG_EXPAND_SZ"

is on the same line as the one on top...
0
 
LVL 3

Accepted Solution

by:
Corvax021899 earned 600 total points
ID: 6997980
Add this to the script!

dim TempIntPath

TempIntPath = "T:\" & wshNet.UserName & "\TempIneternet"

wshShell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Cache",TempIntPath,"REG_EXPAND_SZ"


wshShell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Cache",TempIntPath,"REG_EXPAND_SZ"
0
 
LVL 4

Author Comment

by:EricWestbo
ID: 6998016
I've actually taken the info from the script and done a work-around right in regedit...


1) HKU\.DEFAULT\Environment\TEMP = T:\Temp

2) HKU\.DEFAULT\Environment\TMP  = T:\Temp

3) HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\
Explorer\User Shell Folders\Cache = T:\Temporary Internet Files

4) HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\
Explorer\User Shell Folders\Cookies = T:\Cookies

5) Same changes in HKCU\

This is enabling me to dump all the trash into one volume which will then be cleaned up as part of my maintenance program.  Keeps clutter off the sysVol.

Still playing, but couldn't have done it without your help.

Thanks again...

/ew
0
 
LVL 3

Expert Comment

by:Corvax021899
ID: 6998021
No problem... My pleasure

Corvax
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question