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]