1st posting - FileSystemObject question 
Author Message
 1st posting - FileSystemObject question

1st posting - FileSystemObject questionOn NT case is preserved, not Win95 (and maybe 98) it's forced to all uppercase.

If ucase(d.sharename) = ucase(testdrv) Then
   ...        

--
Michael Harris

  The following code is meant to map my s: drive to one share or another depending on what share it's mapped to to begin with and works fine on WinNT or Win2K.  It does not work on Win95b though.  On Win95, d.sharename and testdrv are never equal.  I've scoured the documentation I have and have found nothing to explain this.  wscript.version shows 5.0.

  My question is, does WSH and/or VBScript act differently under win95 in some instances than on WinNT or Win2K?

  Thank in advance for any responses/suggestions....

  Dan

  .
  .
  .
  drvpath = "s:"
  proddrv = "\\srv03\corp"
  testdrv = "\\srv03\test"

  Set fso = CreateObject("Scripting.FileSystemObject")
  Set d = fso.GetDrive(fso.GetDriveName(fso.GetAbsolutePathName(drvpath)))
  Set WshNetwork = Wscript.CreateObject("Wscript.Network")

  If d.sharename = testdrv Then
          WshNetwork.RemoveNetworkDrive "S:"
          WshNetwork.MapNetworkDrive "S:", proddrv
  Else
          WshNetwork.RemoveNetworkDrive "S:"
          WshNetwork.MapNetworkDrive "S:", testdrv
  End If
  .
  .
  .



Tue, 23 Jul 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. FAQ = Frequently Asked Questions - vba - Please read before posting questions - unofficial - March posting

2. FAQ: Frequently Asked Questions - vba - please read before posting questions - unofficial February posting

3. FAQ - Frequently Asked Questions - vba - Please read before posting questions - unofficial - Jan 2003 posting

4. FAQ - frequently asked VBA questions - please read before posting questions - September posting - unofficial

5. FAQ - Frequently Asked Questions (vba) - please read before posting questions - August posting - unofficial

6. FAQ - Frequently Asked Questions - unoffical July posting - please read before posting questions - vba

7. FAQ - Frequently Asked Questions - unofficial June posting - please read before posting questions

8. FAQ - Frequently Asked Questions - unofficial - please read before posting your questions - March posting

9. FAQ - Frequently Asked Questions - unofficial June posting - please read before posting questions

10. 1st Post, Need ideas

11. FAQ - frequently asked questions - vba - please read before posting - unofficial - June posting

12. FAQ - frequently asked questions - vba - please read before posting - unofficial - May posting

 

 
Powered by phpBB® Forum Software