/build/static/layout/Breadcrumb_cap_w.png

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


1 Comment   [ + ] Show comment
  • When you see this type of nonsense:

    [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 10 years ago

Answers (2)

Posted by: pcooper 10 years ago
Senior White Belt
0

Where is the rest of the code after "Dim oWMI, colProc, oProcess, sUser, sDomain"

Posted by: pjgeutjens 10 years ago
Red Belt
0

What commandline are you using to call this script? Cause error 193 seems to suggest you're not calling a valid win32 executable.. (193: %1 is not a valid Win32 application)

Maybe you're forgetting to run the script through cscript.exe <yourscript.vbs>?

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ