|
|
I am having trouble figuring this out, could someone help me. I wouldn't doubt that I way out in left field.
Any help would be appreciated, Dave
\\SERVER\Clients\Setup\setup.exe /s SERVER
Set objSysInfo = CreateObject("ADSystemInfo") strUser = objSysInfo.UserName Set objUser = GetObject("LDAP://" & strUser strUserName = objUser.samAccountName strOUPath = objUser.Parent arrContainers = Split(strOUPath, ",") arrOU = Split(arrContainers(0), "=") strOU = arrOU(1) set objNetwork = CreateObjects("Wscript.Network")
objNetwork.MapNetworkDrive "M:", "\\Server\Music" objNetwork.MapNetworkDrive "P:", "\\Server\Pictures" objNetwork.MapNetworkDrive "S:", "\\Server\Shared Folders"
If CurrentUser = "Adrianna" Then
objNetwork.MapNetworkDrive "H:", "\\Server\Household Stuff" objNetwork.MapNetworkDrive "I:", "\\Server\Downloads" objNetwork.MapNetworkDrive "L:", "\\Server\Educational Disks"
ElseIf CurrentUser = "Dave" Then
objNetwork.MapNetworkDrive "H:", "\\Server\Household Stuff" objNetwork.MapNetworkDrive "I:", "\\Server\Downloads" objNetwork.MapNetworkDrive "K:", "\\Server\ClientApps" objNetwork.MapNetworkDrive "L:", "\\Server\Educational Disks" objNetwork.MapNetworkDrive "J:", "\\Server\Dave's Stuff" objNetwork.MapNetworkDrive "Q:", "\\Server\RIS" objNetwork.MapNetworkDrive "R:", "\\Server\RemoteInstall" objNetwork.MapNetworkDrive "T:", "\\Server\Misc Text Files" objNetwork.MapNetworkDrive "V:", "\\Server\Dave's Programming Stuff" objNetwork.MapNetworkDrive "W:", "\\Server\Web Sites" objNetwork.MapNetworkDrive "Z:", "\\Server\System Backups"
ElseIf CurrentUser = "Administrator" Then
objNetwork.MapNetworkDrive "H:", "\\Server\Household Stuff" objNetwork.MapNetworkDrive "I:", "\\Server\Downloads" objNetwork.MapNetworkDrive "K:", "\\Server\ClientApps" objNetwork.MapNetworkDrive "L:", "\\Server\Educational Disks" objNetwork.MapNetworkDrive "J:", "\\Server\Dave's Stuff" objNetwork.MapNetworkDrive "Q:", "\\Server\RIS" objNetwork.MapNetworkDrive "R:", "\\Server\RemoteInstall" objNetwork.MapNetworkDrive "T:", "\\Server\Misc Text Files" objNetwork.MapNetworkDrive "V:", "\\Server\Dave's Programming Stuff" objNetwork.MapNetworkDrive "W:", "\\Server\Web Sites" objNetwork.MapNetworkDrive "Z:", "\\Server\System Backups"
ElseIf CurrentUser = "Other" Then
objNetwork.MapNetworkDrive "H:", "\\Server\Household Stuff" objNetwork.MapNetworkDrive "I:", "\\Server\Downloads" objNetwork.MapNetworkDrive "K:", "\\Server\ClientApps" objNetwork.MapNetworkDrive "L:", "\\Server\Educational Disks" objNetwork.MapNetworkDrive "J:", "\\Server\Dave's Stuff" objNetwork.MapNetworkDrive "Q:", "\\Server\RIS" objNetwork.MapNetworkDrive "R:", "\\Server\RemoteInstall" objNetwork.MapNetworkDrive "T:", "\\Server\Misc Text Files" objNetwork.MapNetworkDrive "V:", "\\Server\Dave's Programming Stuff" objNetwork.MapNetworkDrive "W:", "\\Server\Web Sites" objNetwork.MapNetworkDrive "X:", "\\Server\Other Stuff" objNetwork.MapNetworkDrive "Z:", "\\Server\Educational Disks"
End If
|
|
Did you forget to include your question?
|
|
I am wondering what is wrong with this code.
Thanks, Dave
"Marty List" <usenet[ at ]optimumx.com> wrote in message news:B5E6070E-C72A-419F-9BD0-ECA14C16E029[ at ]microsoft.com...
[Quoted Text] > > Did you forget to include your question? > >
|
|
Most people would be helpful and post the error messages, which lines are failing. You want others to do more work than is necessary because you're not willing to post specific questions.
- This line is missing a right parenthesis ")": Set objUser = GetObject("LDAP://" & strUser
- These lines seems irrelevant/unnecessary: strOUPath = objUser.Parent arrContainers = Split(strOUPath, ",") arrOU = Split(arrContainers(0), "=") strOU = arrOU(1)
- Replace all occurrences of "CurrentUser" with "strUserName", for example this line: If CurrentUser = "Adrianna" Then should be: If strUserName = "Adrianna" Then
"Dave" <junk[ at ]junkmail.com> wrote in message news:%23$WJCRBnHHA.4960[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text] >I am wondering what is wrong with this code. > > Thanks, > Dave > > > "Marty List" <usenet[ at ]optimumx.com> wrote in message > news:B5E6070E-C72A-419F-9BD0-ECA14C16E029[ at ]microsoft.com... >> >> Did you forget to include your question? >> >> >
|
|
"Marty List" <usenet[ at ]optimumx.com> wrote in message news:94AE6958-FD10-47E2-A560-DA2B6EB377EB[ at ]microsoft.com...
[Quoted Text] > > Most people would be helpful and post the error messages, which lines are > failing. You want others to do more work than is necessary because you're > not willing to post specific questions. > > > - This line is missing a right parenthesis ")": > Set objUser = GetObject("LDAP://" & strUser > > > - These lines seems irrelevant/unnecessary: > strOUPath = objUser.Parent > arrContainers = Split(strOUPath, ",") > arrOU = Split(arrContainers(0), "=") > strOU = arrOU(1) > > > - Replace all occurrences of "CurrentUser" with "strUserName", for example > this line: > If CurrentUser = "Adrianna" Then > should be: > If strUserName = "Adrianna" Then
Also, I suspect that this statement:
ElseIf CurrentUser = "Other" Then
should probably be replaced with this one:
Else
Unless, of course, there actually is a user whose name is "Other".
/Al
> > > > "Dave" <junk[ at ]junkmail.com> wrote in message > news:%23$WJCRBnHHA.4960[ at ]TK2MSFTNGP02.phx.gbl... >>I am wondering what is wrong with this code. >> >> Thanks, >> Dave >> >> >> "Marty List" <usenet[ at ]optimumx.com> wrote in message >> news:B5E6070E-C72A-419F-9BD0-ECA14C16E029[ at ]microsoft.com... >>> >>> Did you forget to include your question? >>> >>> >> >
|
|
My bad Marty, I am used to Visual Basic and have never posted on this site before. I will try out the changes you mention and repost with any errors I find later tonight. I will be sure to include all error messages at that time.
Dave Marden
"Marty List" wrote:
[Quoted Text] > > Most people would be helpful and post the error messages, which lines are > failing. You want others to do more work than is necessary because you're > not willing to post specific questions. > > > - This line is missing a right parenthesis ")": > Set objUser = GetObject("LDAP://" & strUser > > > - These lines seems irrelevant/unnecessary: > strOUPath = objUser.Parent > arrContainers = Split(strOUPath, ",") > arrOU = Split(arrContainers(0), "=") > strOU = arrOU(1) > > > - Replace all occurrences of "CurrentUser" with "strUserName", for example > this line: > If CurrentUser = "Adrianna" Then > should be: > If strUserName = "Adrianna" Then > > > > "Dave" <junk[ at ]junkmail.com> wrote in message > news:%23$WJCRBnHHA.4960[ at ]TK2MSFTNGP02.phx.gbl... > >I am wondering what is wrong with this code. > > > > Thanks, > > Dave > > > > > > "Marty List" <usenet[ at ]optimumx.com> wrote in message > > news:B5E6070E-C72A-419F-9BD0-ECA14C16E029[ at ]microsoft.com... > >> > >> Did you forget to include your question? > >> > >> > > >
|
|
|