Announcement

Collapse
No announcement yet.

vb OUTPUT TO FIEL

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • vb OUTPUT TO FIEL

    HI )

    Try to output command to a file on network but it doesnot work please help ??

    Option Explicit
    Dim objShell, intShutdown
    Dim strShutdown, strAbort

    ' -s = shutdown, -t 120 = 2 minutes, -f = force programs to close
    strShutdown = "shutdown.exe /m \\PC-190 /R /T 300 /C """ & " Computer Will Reboot Now !!! """ >> \\10.1.0.4\Setup\Logs\Shutdown.txt 2>&1

    set objShell = CreateObject("WScript.Shell")
    ' wscript.echo strCommand
    objShell.Run strShutdown, 0, false

    Wscript.Quit

  • #2
    this line work perfectly but i want to output error to file
    strShutdown = "shutdown.exe /m \\PC-190 /R /T 300 /C """ & " Computer Will Reboot Now !!! """

    this wont work

    strShutdown = "shutdown.exe /m \\PC-190 /R /T 300 /C """ & " Computer Will Reboot Now !!! """ >> \\10.1.0.4\Setup\Logs\Shutdown.txt 2>&1

    Comment


    • #3
      You will need to open the txt file then write to it and then close it again.

      https://technet.microsoft.com/en-au/...or=-2147217396

      Comment

      Working...
      X