![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | make vbs non case sensitive? can anyone assist with making this non-case sensitive? On Error Resume Next Dim strMsg Dim Answer Dim title Dim message Dim fso Set fso = Createobject("Scripting.FileSystemObject") Set WshShell = CreateObject("Wscript.Shell") Set WshNetwork = WScript.CreateObject("WScript.Network") Set args = WScript.Arguments title = "REMOVAL TOOL!!!" message = "Enter an ID to continue:" uname = InputBox(message, title) Msg = strMsg Answer = MsgBox("FULLY DELETE" &" "& uname &" from REMOTE ACCESS SERVERS?", vbInformation + vbYesNoCancel, "Termination Profile Removal Tool") If Answer = vbYes Then fso.DeleteFolder "\\server2\c$\documents and settings\"&uname, True fso.DeleteFolder "\\server3\c$\documents and settings\"&uname, True fso.DeleteFolder "\\server4\c$\documents and settings\"&uname, True fso.DeleteFolder "\\server5\c$\documents and settings\"&uname, True fso.DeleteFolder "\\serverx\c$\documents and settings\"&uname, True fso.DeleteFolder "\\server01\roam$\"&uname, True wscript.echo "Removal of Profile" &" "& uname &" from REMOTE ACCESS SERVERS is Complete" else if Answer = vbNo Then end if Cancel = True End If |
My System Specs![]() |
| | #2 (permalink) |
| | Re: make vbs non case sensitive? David wrote: Quote: > can anyone assist with making this non-case sensitive? > > In those cases where case does come into play, the way around it is to use UCASE or LCASE to make everything into one case or the other. It might be helpful if you could point to some specific line of code that is causing your problem. cheers, jw ____________________________________________________________ You got questions? WE GOT ANSWERS!!! ..(but, no guarantee the answers will be applicable to the questions) |
My System Specs![]() |
| | #3 (permalink) |
| | Re: make vbs non case sensitive? "David" <David@newsgroup> wrote in message news:eBEdZLQSKHA.6048@newsgroup Quote: > can anyone assist with making this non-case sensitive? > > > On Error Resume Next > Dim strMsg > Dim Answer > Dim title > Dim message > Dim fso > Set fso = Createobject("Scripting.FileSystemObject") > Set WshShell = CreateObject("Wscript.Shell") > Set WshNetwork = WScript.CreateObject("WScript.Network") > Set args = WScript.Arguments > > title = "REMOVAL TOOL!!!" > message = "Enter an ID to continue:" > uname = InputBox(message, title) > > Msg = strMsg > Answer = MsgBox("FULLY DELETE" &" "& uname &" from REMOTE ACCESS > SERVERS?", vbInformation + vbYesNoCancel, "Termination Profile Removal > Tool") > If Answer = vbYes Then > fso.DeleteFolder "\\server2\c$\documents and settings\"&uname, True > fso.DeleteFolder "\\server3\c$\documents and settings\"&uname, True > fso.DeleteFolder "\\server4\c$\documents and settings\"&uname, True > fso.DeleteFolder "\\server5\c$\documents and settings\"&uname, True > fso.DeleteFolder "\\serverx\c$\documents and settings\"&uname, True > fso.DeleteFolder "\\server01\roam$\"&uname, True > wscript.echo "Removal of Profile" &" "& uname &" from REMOTE ACCESS > SERVERS is Complete" > > else if Answer = vbNo Then > end if > Cancel = True > End If There are two methods in VB Scripting to ignore the case: a) In certain functions such as InStr: set the appropriate parameter that deals with ASCII/Binary comparison. b) In all other cases: Perform the comparison by translating both elements to lower case, using the LCase function. You could use the UCase function too, of course. |
My System Specs![]() |
| | #4 (permalink) |
| | Re: make vbs non case sensitive? i got it working.. thanks for the quick reply. "Pegasus [MVP]" <news@newsgroup> wrote in message news:emBWjSQSKHA.4116@newsgroup Quote: > > "David" <David@newsgroup> wrote in message > news:eBEdZLQSKHA.6048@newsgroup Quote: >> can anyone assist with making this non-case sensitive? >> >> >> On Error Resume Next >> Dim strMsg >> Dim Answer >> Dim title >> Dim message >> Dim fso >> Set fso = Createobject("Scripting.FileSystemObject") >> Set WshShell = CreateObject("Wscript.Shell") >> Set WshNetwork = WScript.CreateObject("WScript.Network") >> Set args = WScript.Arguments >> >> title = "REMOVAL TOOL!!!" >> message = "Enter an ID to continue:" >> uname = InputBox(message, title) >> >> Msg = strMsg >> Answer = MsgBox("FULLY DELETE" &" "& uname &" from REMOTE ACCESS >> SERVERS?", vbInformation + vbYesNoCancel, "Termination Profile Removal >> Tool") >> If Answer = vbYes Then >> fso.DeleteFolder "\\server2\c$\documents and settings\"&uname, True >> fso.DeleteFolder "\\server3\c$\documents and settings\"&uname, True >> fso.DeleteFolder "\\server4\c$\documents and settings\"&uname, True >> fso.DeleteFolder "\\server5\c$\documents and settings\"&uname, True >> fso.DeleteFolder "\\serverx\c$\documents and settings\"&uname, True >> fso.DeleteFolder "\\server01\roam$\"&uname, True >> wscript.echo "Removal of Profile" &" "& uname &" from REMOTE ACCESS >> SERVERS is Complete" >> >> else if Answer = vbNo Then >> end if >> Cancel = True >> End If > Which part of your code do you wish to make case-insensitive? > > There are two methods in VB Scripting to ignore the case: > a) In certain functions such as InStr: set the appropriate parameter that > deals with ASCII/Binary comparison. > b) In all other cases: Perform the comparison by translating both elements > to lower case, using the LCase function. You could use the UCase function > too, of course. > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Problem with Case-Sensitive fieldnames | .NET General | |||
| Case-sensitive Keys and Strings | PowerShell | |||
| Re: replace method is case sensitive | PowerShell | |||
| Case-sensitive -replace command | PowerShell | |||
| Filesystem Still Case Sensitive After Uninstalling SUA | Vista General | |||