Results 1 to 6 of 6

Thread: PC_ShutDown

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    PC_ShutDown

    Hi Eros,

    help says I can use $PC_MY_PC constant to get my PC name, so I can shutdown it softly ... but it seems this constant is not predefined.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: PC_ShutDown

    Hope Roberto will have a look. PC module is a Roberto's creature

    Anyhow, I checked the code and I think equate is named $PC_SD_MY_PC (so help is wrong, I will amend it) and it is just an empty string.
    When the string is empty, local PC is considered.

    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: PC_ShutDown

    Thank you,

    I can use it with your advices now!
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4

    Re: PC_ShutDown

    $PC_SD_MY_PC is a constant that should be used only as first parameters of PC_ShutDown() function.
    It is required to indicate that computer on which you want to act is the local one (not remote) otherwise you should pass the host name.

    [code=thinbasic]uses "PC"

    TBMAIN()

    FUNCTION TBMAIN () AS LONG

    ' Act on my PC (LOCAL)
    PC_ShutDown($PC_MY_PC, "System ShutDown ...", %PC_SD_DONOT_REBOOT, 7, %PC_SD_DONOT_FORCE)

    ' Act on the network computer named APOLLOIV
    PC_ShutDown("APOLLOIV", "System ShutDown ...", %PC_SD_DONOT_REBOOT, 7, %PC_SD_DONOT_FORCE)

    END FUNCTION
    [/code]

    Ciao,
    Roberto
    http://www.thinbasic.com

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: PC_ShutDown

    Roberto,

    in your script you refer again to $PC_MY_PC while correct one is $PC_SD_MY_PC
    That was the original Petr's question.

    I've already fixed help material and examples. Will be present in next release.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  6. #6

    Re: PC_ShutDown

    Also the sample script ShutDown.tBasic holds the wrong equate.

    Roberto
    http://www.thinbasic.com

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •