PC Review


Reply
Thread Tools Rate Thread

How do I make an exception for a user?

 
 
Mickey
Guest
Posts: n/a
 
      5th Aug 2003
I have the following script to set the users registry to
point to the H:\ drive. It maps My Documents to our file
server.

Dim WSHShell
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:
{impersonationLevel=impersonate}!\\" & strComputer
& "\root\default:StdRegProv")

strKeyPath
= "Software\Microsoft\Windows\CurrentVersion\Explorer\User
Shell Folders"
strEntryName = "Personal"
strValueName = "H:\"
objReg.GetStringValue HKEY_CURRENT_USER, strKeyPath,
strEntryName, strValue
'Wscript.Echo "The current Home Folder is " & strValue
If strValue <> "H;\" Then
objReg.SetStringValue HKEY_CURRENT_USER, strKeyPath,
strEntryName, strValueName
End If

However, I have a few specific users that need to have an
exception made. in a KIX32 script it would look something
like this
If @userid = 'joeuser'
else
writevalue
("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersi
on\Explorer\User Shell
Folders","Personal","h:\","REG_EXPAND_SZ")
endif

This would exclude the user joeuser from having this
registry change made to his system. (hint: joeuser is a
CFO)

My question is how would I do the same thing with the
vbscript?

 
Reply With Quote
 
 
 
 
Dave Patrick
Guest
Posts: n/a
 
      5th Aug 2003
Better to ask in a scripting group.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft MVP [Windows NT/2000 Operating Systems]

"Mickey" wrote:
> I have the following script to set the users registry to
> point to the H:\ drive. It maps My Documents to our file
> server.
>
> Dim WSHShell
> Const HKEY_CURRENT_USER = &H80000001
> strComputer = "."
> Set objReg = GetObject("winmgmts:
> {impersonationLevel=impersonate}!\\" & strComputer
> & "\root\default:StdRegProv")
>
> strKeyPath
> = "Software\Microsoft\Windows\CurrentVersion\Explorer\User
> Shell Folders"
> strEntryName = "Personal"
> strValueName = "H:\"
> objReg.GetStringValue HKEY_CURRENT_USER, strKeyPath,
> strEntryName, strValue
> 'Wscript.Echo "The current Home Folder is " & strValue
> If strValue <> "H;\" Then
> objReg.SetStringValue HKEY_CURRENT_USER, strKeyPath,
> strEntryName, strValueName
> End If
>
> However, I have a few specific users that need to have an
> exception made. in a KIX32 script it would look something
> like this
> If @userid = 'joeuser'
> else
> writevalue
> ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersi
> on\Explorer\User Shell
> Folders","Personal","h:\","REG_EXPAND_SZ")
> endif
>
> This would exclude the user joeuser from having this
> registry change made to his system. (hint: joeuser is a
> CFO)
>
> My question is how would I do the same thing with the
> vbscript?
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Out of the office - How can I make an exception? danton08 Microsoft Outlook Discussion 1 18th Jun 2009 10:35 PM
How to make an Exception query Peter Hibbs Microsoft Access 2 1st Feb 2007 06:53 PM
Odd exception that doesn't make sense to me =?Utf-8?B?YmFsbWVyY2g=?= Microsoft Dot NET 1 24th Feb 2006 07:28 AM
How do I make an exception for a user? Mickey Microsoft Windows 2000 Registry Archive 2 5th Aug 2003 10:35 PM
How do I make an exception for a user? Mickey Microsoft Windows 2000 Registry Archive 0 5th Aug 2003 10:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:46 AM.