Django
19-11-2014, 17:13
Hello,
When I attempt to create a file containing a list of Windows Hotfixes using the WMIC command, I encounter the following error: Invalid XSL format (or) file name.
If I paste the command that is placed on the clipboard by the script directly into a CMD dialog box, it works fine. Also, if I shorten the command to just
wmic qfe list full /format:htable , this also works. Below is the script.
Hoping someone can help.
Cheers
' Create file containing list of Windows Hotfixes
' using the Windows Management Instrumentation Command (WMIC)
' command. This can produce and HTML file (cmdh) or a TXT file
' (cmdt).
Uses "OS"
Dim wm As String Value "wmic qfe list full "
Dim h1 As String Value "/format:htable > "
Dim h2 As String Value "%USERPROFILE%\hotfix.html"
Dim t1 As String Value "/format:texttablewsys > "
Dim t2 As String Value "%USERPROFILE%\hotfix.txt"
Dim cmdh As String
Dim cmdt As String
cmdh = wm & h1 & $DQ & h2 & $DQ
cmdt = wm & t1 & $DQ & t2 & $DQ
OS_Shell(cmdh, %OS_WNDSTYLE_MAXIMIZED, %OS_SHELL_SYNC)
ClipBoard_SetText(cmdh)
MsgBox(0, cmdh)
When I attempt to create a file containing a list of Windows Hotfixes using the WMIC command, I encounter the following error: Invalid XSL format (or) file name.
If I paste the command that is placed on the clipboard by the script directly into a CMD dialog box, it works fine. Also, if I shorten the command to just
wmic qfe list full /format:htable , this also works. Below is the script.
Hoping someone can help.
Cheers
' Create file containing list of Windows Hotfixes
' using the Windows Management Instrumentation Command (WMIC)
' command. This can produce and HTML file (cmdh) or a TXT file
' (cmdt).
Uses "OS"
Dim wm As String Value "wmic qfe list full "
Dim h1 As String Value "/format:htable > "
Dim h2 As String Value "%USERPROFILE%\hotfix.html"
Dim t1 As String Value "/format:texttablewsys > "
Dim t2 As String Value "%USERPROFILE%\hotfix.txt"
Dim cmdh As String
Dim cmdt As String
cmdh = wm & h1 & $DQ & h2 & $DQ
cmdt = wm & t1 & $DQ & t2 & $DQ
OS_Shell(cmdh, %OS_WNDSTYLE_MAXIMIZED, %OS_SHELL_SYNC)
ClipBoard_SetText(cmdh)
MsgBox(0, cmdh)