Advertisement
Advertisement
| 05.05.2008 at 11:56AM PDT, ID: 23377325 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: |
Sub logExec(strCommand)
dim objShell, objExecObject, strOutput
Set objshell = wscript.creatobject("wscript.shell")
Set objExecObject = objShell.Exec(strCommand)
Do Until objExecObject.Stdout.AtEndOfStream
strOutput = objExecObject.Stdout.ReadLine()
wrtielog(strOutput)
WScript.Echo strOutput
loop
end sub
|
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 05.05.2008 at 12:13PM PDT, ID: 21502244 |
| 05.05.2008 at 02:30PM PDT, ID: 21503187 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: |
Sub logExecToFile(strCommand)
dim objShell, objExecObject, strOutput, objFSO
Const intForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objshell = CreatObject("wscript.shell")
strOutput = "myFile.txt"
objShell.Run strCommand & " > " & strOutput, 1, True
Set objFile = objFSO.OpenTextFile(strOutput, intForReading, False)
strContents = objFile.ReadAll
objFile.Close
Set objFile = Nothing
MsgBox strContents
end Sub
|
| 05.05.2008 at 07:09PM PDT, ID: 21504322 |
| 05.05.2008 at 09:21PM PDT, ID: 21504736 |
| 05.06.2008 at 06:49PM PDT, ID: 21512576 |
| 05.06.2008 at 07:46PM PDT, ID: 21512834 |
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: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: |
Set wshExt = CreateObject("WSHExtend.WinExt")
lngProcessID = wshExt.WSHShell("wscript """ & Replace(Wscript.ScriptFullName, WScript.ScriptName, "") & "Script2.vbs""", 1)
strComputer = "."
lngCmdProcess = 0
strOutputFile = Replace(Wscript.ScriptFullName, WScript.ScriptName, "") & "Result.txt"
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Do
Set colItems = objWMIService.ExecQuery("SELECT ProcessID FROM Win32_Process WHERE ParentProcessID=" & lngProcessID & " AND Name='cmd.exe'", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
lngCmdProcess = objItem.ProcessID
Next
Loop Until lngCmdProcess > 0
'MsgBox lngProcessID
' Wait for the DOS window to become active
'intCount = 0
'Do
' intCount = intCount + 1
' ' CHANGE THE intCount VALUE IF YOU REQUIRE MORE Time
' If intCount = 10000 Then
' MsgBox lngCmdProcess & " could not be found"
' Exit Do
' End If
'Loop Until wshExt.WSHAppActivate(lngCmdProcess) = 0
'wshExt.WSHSendKeys "(% )", True
wshExt.WSHWait 100
wshExt.WSHAppActivate(lngCmdProcess)
wshExt.WSHSendKeys "ES", True
wshExt.WSHAppActivate(lngCmdProcess)
wshExt.WSHSendKeys "(% )", True
wshExt.WSHAppActivate(lngCmdProcess)
wshExt.WSHSendKeys "ES", True
wshExt.WSHAppActivate(lngCmdProcess)
wshExt.WSHSendKeys "{ENTER}", True
wshExt.WSHWait 50
wshExt.WSHShell "cmd /c taskkill /F /PID " & lngCmdProcess, 0
'If wshExt.WSHAppActivate(lngCmdProcess) = 0 Then
'wshExt.WSHSendKeys "ES{ENTER}", True
'wshExt.WSHSendKeys "{ENTER}", True
'wshExt.WSHSendKeys "EK", True
'For iVal = 1 To 24
' wshExt.WSHSendKeys "+{DOWN}", True
'Next
'For iVal = 1 To 80
' wshExt.WSHSendKeys "+{RIGHT}", True
'Next
'wshExt.WSHSendKeys "{ENTER}", True
'Else
' MsgBox lngCmdProcess & " was lost."
'End If
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("about:blank")
strClipboardText = objIE.document.parentwindow.clipboardData.GetData("text")
objIE.Quit
'MsgBox strClipboardText
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objOutputFile = objFSO.CreateTextFile(strOutputFile, True)
objOutputFile.Write strClipboardText
objOutputFile.Close
Set objOutputFile = Nothing
Set objFSO = Nothing
wshExt.WSHShell "notepad " & strOutputFile, 1
'Msgbox "Done"
Sub GetWindow
intCount = 0
Do
intCount = intCount + 1
If intCount = 1000 Then
MsgBox lngCmdProcess & " could not be found"
End IF
Loop Until wshExt.WSHAppActivate(lngCmdProcess) = 0
End Sub
|
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: |
Sub logExec(strCommand)
dim objShell, objExecObject, strOutput
Set objshell = wscript.creatobject("wscript.shell")
Set objExecObject = objShell.Exec(strCommand)
Do Until objExecObject.StdErr.AtEndOfStream
strOutput = objExecObject.StdErr.ReadLine()
writelog(strOutput)
WScript.Echo strOutput
loop
end sub
|