topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday May 28, 2024, 9:43 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

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

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 554
    • View Profile
    • Donate to Member
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,742
    • View Profile
    • Donate to Member
Re: Simple: Desktop shortcut/script to restart to USB drive
« Reply #1 on: May 11, 2023, 02:29 PM »
@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: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: Simple: Desktop shortcut/script to restart to USB drive
« Reply #2 on: May 11, 2023, 08:13 PM »
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
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: May 12, 2023, 12:25 AM by publicdomain »

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 554
    • View Profile
    • Donate to Member
Re: Simple: Desktop shortcut/script to restart to USB drive
« Reply #3 on: May 11, 2023, 11:17 PM »
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 11, 2023, 11:32 PM by nkormanik »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: Simple: Desktop shortcut/script to restart to USB drive
« Reply #4 on: May 12, 2023, 12: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:)
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com