BalaSee
asked on
Converto to Uppercase
I want to convert a text file content (all) into uppercase ...not the file name, but the content inside the text file
ASKER
-------------------------- -
Windows Script Host
-------------------------- -
Script: D:\test\folderaccess.vbs
Line: 7
Char: 18
Error: Invalid 'exit' statement
Code: 800A040F
Source: Microsoft VBScript compilation error
-------------------------- -
OK
-------------------------- -
Windows Script Host
--------------------------
Script: D:\test\folderaccess.vbs
Line: 7
Char: 18
Error: Invalid 'exit' statement
Code: 800A040F
Source: Microsoft VBScript compilation error
--------------------------
OK
--------------------------
Quite so the problem was I tested in VBA for ease!
Chris
Chris
str = "c:\deleteme\somefile.txt"
Set fso = CreateObject("scripting.filesystemobject")
If fso.FileExists(str) Then
Set fil = fso.opentextfile(str, 1, False)
If not fil.atendofstream Then
str = UCase(fil.readall)
fil.Close
Set fil = fso.opentextfile(str, 2)
fil.Write str
fil.Close
End If
End If
ASKER
-------------------------- -
Windows Script Host
-------------------------- -
Script: D:\test\folderaccess.vbs
Line: 8
Char: 13
Error: Bad file name or number
Code: 800A0034
Source: Microsoft VBScript runtime error
-------------------------- -
OK
-------------------------- -
Windows Script Host
--------------------------
Script: D:\test\folderaccess.vbs
Line: 8
Char: 13
Error: Bad file name or number
Code: 800A0034
Source: Microsoft VBScript runtime error
--------------------------
OK
--------------------------
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window