Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Creating a batch file  (Read 3066 times)

0 Members and 1 Guest are viewing this topic.

Iharries

    Topic Starter


    Greenhorn

    Creating a batch file
    « on: October 13, 2009, 03:57:50 PM »
    I would like to create a batch file that would log off the current user and shut down by itself once its completely logged off. I think it's possible but i don't know how. And no, simply shutting down the computer without logging off isn't what I'm looking for. Could someone present a command/s that will do this for me?

    Helpmeh



      Guru

    • Roar.
    • Thanked: 123
      • Yes
      • Yes
    • Computer: Specs
    • Experience: Familiar
    • OS: Windows 8
    Re: Creating a batch file
    « Reply #1 on: October 13, 2009, 04:04:52 PM »
    Shutdown -l -t 01

    That should do it.
    Where's MagicSpeed?
    Quote from: 'matt'
    He's playing a game called IRL. Great graphics, *censored* gameplay.

    Iharries

      Topic Starter


      Greenhorn

      Re: Creating a batch file
      « Reply #2 on: October 13, 2009, 04:32:47 PM »
      So i tried the command "START C:\windows\system32\Shutdown.exe -l -t 10" and launched it, but doesn't do anything... Am I doing something wrong?

      Helpmeh



        Guru

      • Roar.
      • Thanked: 123
        • Yes
        • Yes
      • Computer: Specs
      • Experience: Familiar
      • OS: Windows 8
      Re: Creating a batch file
      « Reply #3 on: October 13, 2009, 05:31:09 PM »
      Try without the start command. Just use shutdown with the switches.
      Where's MagicSpeed?
      Quote from: 'matt'
      He's playing a game called IRL. Great graphics, *censored* gameplay.

      Iharries

        Topic Starter


        Greenhorn

        Re: Creating a batch file
        « Reply #4 on: October 13, 2009, 06:08:00 PM »
        it doesn't work either, by removing the "Start" command. when i use this "Shutdown -l -t 10" it's causing a cmd prompt to come up,showing that the command is being used infinitly... i have to close the window because its just repeating the same command... hmmm

        Helpmeh



          Guru

        • Roar.
        • Thanked: 123
          • Yes
          • Yes
        • Computer: Specs
        • Experience: Familiar
        • OS: Windows 8
        Re: Creating a batch file
        « Reply #5 on: October 13, 2009, 06:40:16 PM »
        What? Can you post a screenshot because I can't picture what you are talking about.
        Where's MagicSpeed?
        Quote from: 'matt'
        He's playing a game called IRL. Great graphics, *censored* gameplay.

        Iharries

          Topic Starter


          Greenhorn

          Re: Creating a batch file
          « Reply #6 on: October 13, 2009, 06:52:10 PM »
          Sure, heres a screenshot



          As you can see on the side scroll, its down pretty far, hence the repeating command.

          Helpmeh



            Guru

          • Roar.
          • Thanked: 123
            • Yes
            • Yes
          • Computer: Specs
          • Experience: Familiar
          • OS: Windows 8
          Re: Creating a batch file
          « Reply #7 on: October 13, 2009, 07:05:10 PM »
          Did you only run shutdown -l -t 10 from the command prompt?
          Where's MagicSpeed?
          Quote from: 'matt'
          He's playing a game called IRL. Great graphics, *censored* gameplay.

          Iharries

            Topic Starter


            Greenhorn

            Re: Creating a batch file
            « Reply #8 on: October 13, 2009, 07:20:53 PM »
            in the *.bat file all that's in there is "Shutdown -l -t 10", when i run the *.bat file, it brings up what you see in the posted screenshot

            billrich

            • Guest
            Re: Creating a batch file
            « Reply #9 on: October 13, 2009, 07:21:55 PM »
             :)
            « Last Edit: October 14, 2009, 07:07:51 AM by billrich »

            Iharries

              Topic Starter


              Greenhorn

              Re: Creating a batch file
              « Reply #10 on: October 13, 2009, 07:43:07 PM »
              This is what happens when i do the command in cmd, it doesn't log off or anything. :-\




              p.s = i appreciate your quick replies!!! ;D