Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scripting Registry changes in Win98 1

Status
Not open for further replies.

richclever

IS-IT--Management
Oct 5, 2000
127
FR
I have written a Vbscript that changes the My Documents folder on my Win98 Clients to the users folder on my NT4 server. This works fine except that although the properties of the folder are correct, when the user double clicks the My Documents icon on the desktop, they are still in the previous persons folder. These folders are Permission denied for all users except the logged on one and the administrator. Can any one help me so that the logged on users folder is displayed. I enclose my scipt below.

dim wshell
set wshell = wscript.createobject ("wscript.shell")
dim wshnetwork
set wshnetwork = wscript.createobject ("wscript.network")
dim username
username = wshnetwork.username
dim userpath
userpath = "\\acnetpdc\users\" + username
wshell.regwrite "HKCU\software\microsoft\windows\currentversion\explorer\user shell folders\personal", userpath
wshell.regwrite "HKCU\software\microsoft\windows\currentversion\shell folders\personal", userpath

dim exists
dim fso
set fso = createobject ("Scripting.filesystemobject")
exists = 0
dim newfolder
newfolder = "\\acnetpdc\users\" + username

if fso.FolderExists (newfolder) then
exists = 1
end if
if exists <> 1 then
fso.CreateFolder (newfolder)
end if
exists = 0


Thanks

Richard
 
Aside from your symptoms you report, the following statement is incorrect (both ocurrences):

newfolder = &quot;\\acnetpdc\users\&quot; + username

it should be

newfolder = &quot;\\acnetpdc\users\&quot; & username

 
In reply to griffinmt, I think you will find that the + works. I have just tested the script, and had a message box display the contents of newfolder, and I get the exact path I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top