scripting error 193
I copied this from itninja to try out but it errors out and I don't know why, any suggestions?
Dim objFSO, newfolder
Dim strComputer, objWMIService
Dim fso, fsHandle, objShell,LogFileName, colItems, objItem
set objFSO=CreateObject("Scripting.FileSystemObject")
If Not objFSO.FolderExists("c:\Windows\KBOX") Then
newfolder = objFSO.CreateFolder ("c:\Windows\KBOX")
End If
Set objShell = CreateObject("Wscript.Shell")
Set fso = Wscript.CreateObject("Scripting.FilesystemObject")
If objFSO.FileExists("c:\Windows\KBOX\local_and_network_drives.txt") Then
fso.DeleteFile "c:\windows\KBOX\local_and_network_drives.txt", True
End If
LogFileName= "C:\Windows\KBOX\local_and_network_drives.txt"
set fsHandle = fso.OpenTextFile (LogFileName,8,True)
sUser = ConsoleUser(".") ' use "." for local computer
Function ConsoleUser(sHost)
' Returns name of user logged on to console
' If no users are logged on, returns ""
Dim oWMI, colProc, oProcess, sUser, sDomain
[code]
set objFSO=CreateObject("Scripting.FileSystemObject")
Set fso = Wscript.CreateObject("Scripting.FilesystemObject")
[/code]
you know instantly that whoever created the script has no clue what they're doing and their output is to be avoided at all costs.
If you don't know why it's nonsense, then you need to do a *lot* more research! - anonymous_9363 11 years ago