-
You, can try this, may be not the best solution
Hi, You can try this 
[vba]
Sub testDOSCommands()
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
DOSCommands = "TASKKILL /F /IM EXCEL.EXE"
'MsgBox DOSCommands
Set objDOSFile = objFSO.CreateTextFile("DOSCommands.bat", 1)
objDOSFile.Write DOSCommands
objDOSFile.Close
strCommand = "cmd /c DOSCommands.bat "
objShell.Run strCommand, 0, True
'objFSO.DeleteFile "DOSCommands.bat", 1
'MsgBox "OK"
'Set objShell = Nothing
'Set objFSO = Nothing
End Sub
[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules