DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Simple: Desktop shortcut/script to restart to USB drive  (Read 10,937 times)

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 563
What should be a piece of cake often seems ridiculously hard.

Restart computer, and open to a specific USB thumb drive.

Create script/batch file to accomplish this.  Or even a little program.

Any thoughts greatly appreciated.

Nicholas Kormanik

KynloStephen66515

  • Animated Giffer in Chief
  • Honorary Member
  • Joined in 2010
  • **
  • Posts: 3,772
    • Participated in NANY Challenge Three Times
    • Cody Award
    • Coding Snacks
    • Official Forum Clown
    • Volunteers/Staff
    • Writer
    • Hardware Hacker
    • DJ Badge - DJ
    • Linux User
Re: Simple: Desktop shortcut/script to restart to USB drive
« Reply #1 on: May 11, 2023, 07:29 PM »
Code
@echo off

rem **SET YOUR DRIVE LETTER**
set /p usb_drive_letter=Enter the letter of the USB drive:

rem **THIS CHECKS IF IT EXISTS**
if not exist "%usb_drive_letter%:\" (
    echo The USB drive is not present.
    pause
    exit /b
)

rem **THIS REBOOTS THE PC TO THE USB DRIVE**
shutdown /r /t 0 /f /fw /s

Not tested because I have no USB boot drives to hand, but it should work.

Use at your own risk

I accept no warantee blah blah blah, basically if you run it and something goes tits up, don't blame me.

You should always check code given to you by anybody on the internet for inconsistencies, errors, or anything dangerous before running it yourself.

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 732
    • Participated in NANY Challenge Three Times
    • Linux User
Re: Simple: Desktop shortcut/script to restart to USB drive
« Reply #2 on: May 12, 2023, 01:13 AM »
Hi Nick! I'm spinning-up a quickie drive letter selection GUI + registry edit project inspired by this :Thmbsup:

Repo @ https://github.com/publicdomain/driveup
« Last Edit: May 12, 2023, 05:25 AM by publicdomain »

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 563
Re: Simple: Desktop shortcut/script to restart to USB drive
« Reply #3 on: May 12, 2023, 04:17 AM »
Goodness, Vic!  Am I in heaven, or what?!

"Open Windows Explorer to a specific drive on next restart."

More precisely, BOOT UP to that particular drive on next restart.

How people presently do this:
-- via bios setting
-- pressing a key at a particular point during startup
-- via Windows settings, restart to particular device

I think the best idea is through a desktop shortcut, if possible.

Thanks to KynloStephen66515 as well!

By the way, I really like Ventoy on a flash drive to boot up to -- packed with relevant .iso files to then load as desired, such as Aronis, WinPE, etc.  Wonderful technology.

https://www.ventoy.net/en/index.html

It's getting the computer to easily reboot to that flash drive that's the challenge.


« Last Edit: May 12, 2023, 04:32 AM by nkormanik »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 732
    • Participated in NANY Challenge Three Times
    • Linux User
Re: Simple: Desktop shortcut/script to restart to USB drive
« Reply #4 on: May 12, 2023, 05:26 AM »
Hello again Nick, please go with the shutdown command in your UEFI system.

The tool I have in mind is inspired by your request yet isn't the same (just edited it up).

(Going to list you as the inspiration for the resulting "DriveUp" program BTW :Thmbsup:)

Original address: https://www.donationcoder.com/forum/index.php?topic=53425.0