Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - make vbs non case sensitive?

Reply
 
Old 10-09-2009   #1 (permalink)
David


 
 

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 SpecsSystem Spec
Old 10-09-2009   #2 (permalink)
mr_unreliable


 
 

Re: make vbs non case sensitive?

David wrote:
Quote:

> can anyone assist with making this non-case sensitive?
>
>
David, generally speaking vbs _IS_ not 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 SpecsSystem Spec
Old 10-09-2009   #3 (permalink)
Pegasus [MVP]


 
 

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
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 SpecsSystem Spec
Old 10-09-2009   #4 (permalink)
David


 
 

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 SpecsSystem Spec
Reply

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


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46