Online tutorials for c programming, cplusplus, Java, Python https://www.trytoprogram.com/ Online tutorials for c programming, cplusplus, Java, Python Sun, 21 Jul 2024 15:00:32 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://www.trytoprogram.com/images/cropped-screenshot-32x32.png Online tutorials for c programming, cplusplus, Java, Python https://www.trytoprogram.com/ 32 32 Batch File Shutdown Commands – How To Shutdown, Reboot And Logoff https://www.trytoprogram.com/batch-file/batch-file-shutdown-commands/ https://www.trytoprogram.com/batch-file/batch-file-shutdown-commands/#respond Sat, 22 Jun 2024 10:04:36 +0000 http://www.trytoprogram.com/?p=2420 In this article, you will learn about different commands and ways to shut down, reboot, and log off the PC. You will learn about batch file shutdown commands in detail. How to shutdown? How to log off? How to hibernate? How to reboot?   How to shutdown computer using cmd/batch file? The command used to […]

The post Batch File Shutdown Commands – How To Shutdown, Reboot And Logoff appeared first on Online tutorials for c programming, cplusplus, Java, Python.

]]>
In this article, you will learn about different commands and ways to shut down, reboot, and log off the PC. You will learn about batch file shutdown commands in detail.

How to shutdown?
How to log off?
How to hibernate?
How to reboot?
 Batch file shutdown commands

How to shutdown computer using cmd/batch file?


The command used to shut down computer is

shutdown /s /f /t 0

Shut down computer using cmd

Follow these steps to shut down the computer using cmd.

  • Run the command prompt
  • Type the above command and hit entershutdown computer using cmdThe computer will shut down immediately after hitting this command.

Shutdown computer using a batch file

Here are the steps to shut down a computer using a batch file.

  • Open a notepad and click on new file
  • Paste the shutdown code stated above and save the file as turn_off.batshutdown computer using batch file
  • Once you have saved the file, click on the .bat file and your computer will start shutting down.

Alternately the following code can be used for immediate shutdown.

SHUTDOWN /p

How to shutdown the computer by setting time using cmd/batch?

The code we stated above is used to shut down the computer immediately after hitting the code. We have to use the following command to set the timing for shutting down.

For example, the following code is used to shut down a computer in 60 seconds.

SHUTDOWN /s /t 60 /c

How to log off a computer using batch/cmd?


Logging off means signing out of from the current logged in account. Here is the code to log off or sign out.

SHUTDOWN /l

where l signifies shortcut command for logging off.

How to hibernate a computer using batch/cmd?


Hibernating is same as shutting down but when you hibernate your computer, it stores and remembers the previous state of the computer before hibernating and it will resume from there.

Here is the code to hibernate a computer.

SHUTDOWN /h

How to reboot a computer using batch/cmd?


Here is the code required to reboot a computer, be it from command prompt or batch file.

Here is the code to reboot a computer.

SHUTDOWN -r -t 10

This is the code to reboot the computer in 10 seconds.

The post Batch File Shutdown Commands – How To Shutdown, Reboot And Logoff appeared first on Online tutorials for c programming, cplusplus, Java, Python.

]]>
https://www.trytoprogram.com/batch-file/batch-file-shutdown-commands/feed/ 0
How to create a custom a template for a blog post in WordPress ? https://www.trytoprogram.com/uncategorized/how-to-create-a-custom-a-template-for-a-blog-post-in-wordpress/ https://www.trytoprogram.com/uncategorized/how-to-create-a-custom-a-template-for-a-blog-post-in-wordpress/#respond Sat, 22 Jun 2024 10:04:28 +0000 http://www.trytoprogram.com/?p=843 Ever wondered, How to create a custom template for a blog post in WordPress? Well if you have, then you are in exact place to find about. In this article, we will explain about the ways of creating a template for a blog post in WordPress. For starters, WordPresss comes with optimized built-in themes to […]

The post How to create a custom a template for a blog post in WordPress ? appeared first on Online tutorials for c programming, cplusplus, Java, Python.

]]>
Ever wondered, How to create a custom template for a blog post in WordPress?

Well if you have, then you are in exact place to find about. In this article, we will explain about the ways of creating a template for a blog post in WordPress.

For starters, WordPresss comes with optimized built-in themes to kick-start our websites. In those templates is the built-in template for pages and posts we publish. Here are the steps to create your own blog post templates:

Step 1: Go to the root directory to where you have installed WordPress

Step 2: Now go to wp-content>themes>your_theme( the theme that is active in your website or blog )

Step 3: Create a new file and name it anything.php ( we have named single-blog-post.php )

Add up following code in this file:

 <?php /* 
* Template Name: custom post 
* Template Post Type: post, page
*/ ?>

<?php get_header(); ?>

 <main id="main" class="site-main" role="main">
 <?php
 while ( have_posts() ) : the_post(); ?>
 <h1><?php the_title(); ?></h1>
 <?php the_content();

 endwhile; // End of the loop.
 ?>
 </main>

<?php get_footer(); ?>

Save the file afterward writing the code.

Once the file is saved, open up a new post or an existing post. Now you will see a new option for switching template as shown in the figure below.

Change it to blog post ( the template we just created for blog posts ) and publish your post or preview it. You can see the result.

The post How to create a custom a template for a blog post in WordPress ? appeared first on Online tutorials for c programming, cplusplus, Java, Python.

]]>
https://www.trytoprogram.com/uncategorized/how-to-create-a-custom-a-template-for-a-blog-post-in-wordpress/feed/ 0