vb OUTPUT TO FIEL

Home Forums Scripting Windows Script Host vb OUTPUT TO FIEL

This topic contains 2 replies, has 3 voices, and was last updated by Avatar dh9650 3 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Avatar
    Zahi738
    Member
    #166393

    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.4SetupLogsShutdown.txt 2>&1

    set objShell = CreateObject(“WScript.Shell”)
    ‘ wscript.echo strCommand
    objShell.Run strShutdown, 0, false

    Wscript.Quit

    Avatar
    dh9650
    Member
    #391372

    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.4SetupLogsShutdown.txt 2>&1

    Avatar
    wullieb1
    Moderator
    #245449

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

    https://technet.microsoft.com/en-au/library/ee198716.aspx?f=255&MSPPError=-2147217396

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.