Create a shortcut or batch file to run command prompt?

teckneeculler

Member
Power User
VIP
Local time
8:06 PM
Messages
512
I have a 6TB archive hard drive in a USB3 dock attached to my main PC.

I want to use a small app called 'Drive Alive' to keep this drive from going to sleep during the day. The app writes a small text file to the drive every 5 minutes.

Drive Alive is a command line program. Its command is 'drivealive x:' where x is the drive letter.

Question: What's the best way to set this up so that I can activate the process with one click?

I'll also want to de-activate the process overnight. I prefer to leave my PC running 24\7 but there's no need for the archive drive to follow suit.

[FONT=&quot]BTW: I'm aware there's a USB 'selective suspend setting' than can be disabled [/FONT][FONT=&quot][FONT=&quot]in Power Plan, but I'd like to have selective manual control over the drive. And yes, it has its own power button, but Drive Alive, coupled with a couple of one-click commands, would better suit my needs.

Suggestions would be appreciated.


[/FONT]
[/FONT]
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
My build
OS
Win7 Ultimate SP1
CPU
Intel Core i5 9400 Coffee Lake 14nm
Motherboard
Asus Prime H310M-E R2.0 (LGA1151)
Memory
16G DDR4
Graphics Card(s)
NVidia GeForce GTX 960
Sound Card
Realtek High Definition Audio (mobo)
Monitor(s) Displays
Asus PA248 24" 16:10 format
Screen Resolution
1920x1200@59Hz
Hard Drives
1863GB Seagate ST2000DM
3726GB Seagate ST4000DM
1863GB Seagate ST2000DM
6TB Seagate
465GB NVMe Samsung SSD 970
PSU
750G2
Case
Tower
Cooling
Standard
Keyboard
USB
Mouse
USB
Internet Speed
920Mbs/480Mbs
Antivirus
Malwarebytes
Browser
Firefox
I know this isn't what you asked, but have you tried experimenting with the KeepAliveHD Settings?
KeepAliveHD - Settings.png
Maybe the "Disable writing if user is not active for" option can do what you need.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
n/a
OS
W7 Ultimate SP1, LM19.2 MATE, W10 Home 1703, W10 Pro 1703 VM, #All 64 bit
CPU
AMD Phenom II x6 1100T, 3.3 GHz
Motherboard
ASUS M4A88T-M/USB3 (AM3)
Memory
12GB DDR3 1333 G-Skill (4GB x 2), G-Skill (2GB x 2)
Graphics Card(s)
NVIDIA GeForce GTX 660
Sound Card
Realtek?
Monitor(s) Displays
Samsung S23B350
Screen Resolution
1920x1080
Hard Drives
WD Green 2TB (SATA), WD Green 3TB (SATA), WD Blue 4TB (SATA), WD Blue 6TB (SATA)
PSU
Cooler Master
Case
Antec GX300 Tower
Cooling
3x Antec TRICOOL 120mm Fans
Mouse
Wired Optical
Internet Speed
DSL
Antivirus
Avast
Browser
Pale Moon (64 bit)
Other Info
2018-12-27 Upgraded HDDs
2015-12-10 Upgraded case, graphics card, storage
2015-08-15 Upgraded motherboard & RAM
2015-07-15 Upgraded LM17.1 to LM17.2
Lehnerus2000: Thanks for your suggestion. It has merits but I think Drive Alive would be better suited to my needs.

I'm quite happy with the archive drive going to sleep 10 or 15 minutes after I go to bed.

But I want to to keep running during the day. Drive Alive should be able to do that - all I want is a simple way to make a shortcut to a command that'll start Drive Alive and another one to stop it.

I would have thought a couple of batch files (with shortcuts to each on the TaskBar) would be best. But I'm no expert with these. Hence my question.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
My build
OS
Win7 Ultimate SP1
CPU
Intel Core i5 9400 Coffee Lake 14nm
Motherboard
Asus Prime H310M-E R2.0 (LGA1151)
Memory
16G DDR4
Graphics Card(s)
NVidia GeForce GTX 960
Sound Card
Realtek High Definition Audio (mobo)
Monitor(s) Displays
Asus PA248 24" 16:10 format
Screen Resolution
1920x1200@59Hz
Hard Drives
1863GB Seagate ST2000DM
3726GB Seagate ST4000DM
1863GB Seagate ST2000DM
6TB Seagate
465GB NVMe Samsung SSD 970
PSU
750G2
Case
Tower
Cooling
Standard
Keyboard
USB
Mouse
USB
Internet Speed
920Mbs/480Mbs
Antivirus
Malwarebytes
Browser
Firefox
I'm thinking, a batch file would do the job - located in the same directory as drivealive, but not neccessarily.
That, and maybe task scheduler would help you accomplish what you're aiming for?

Does drivealive run under its own process? e.g. drivealive.exe?

You could have

Code:
@echo off
drivealive x:
to start it, and use taskkill to end it

Code:
@echo off
taskkill /f /im drivealive.exe
 
Last edited:

My Computer My Computer

OS
Windows 7 x64
Lehnerus2000: Thanks for your suggestion. It has merits but I think Drive Alive would be better suited to my needs.
My bad.

I misinterpreted the program name. :o
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
n/a
OS
W7 Ultimate SP1, LM19.2 MATE, W10 Home 1703, W10 Pro 1703 VM, #All 64 bit
CPU
AMD Phenom II x6 1100T, 3.3 GHz
Motherboard
ASUS M4A88T-M/USB3 (AM3)
Memory
12GB DDR3 1333 G-Skill (4GB x 2), G-Skill (2GB x 2)
Graphics Card(s)
NVIDIA GeForce GTX 660
Sound Card
Realtek?
Monitor(s) Displays
Samsung S23B350
Screen Resolution
1920x1080
Hard Drives
WD Green 2TB (SATA), WD Green 3TB (SATA), WD Blue 4TB (SATA), WD Blue 6TB (SATA)
PSU
Cooler Master
Case
Antec GX300 Tower
Cooling
3x Antec TRICOOL 120mm Fans
Mouse
Wired Optical
Internet Speed
DSL
Antivirus
Avast
Browser
Pale Moon (64 bit)
Other Info
2018-12-27 Upgraded HDDs
2015-12-10 Upgraded case, graphics card, storage
2015-08-15 Upgraded motherboard & RAM
2015-07-15 Upgraded LM17.1 to LM17.2
Thanks, TheDeerDude, I think that'll do it :-)

And thanks for your input, lehenerus2000.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
My build
OS
Win7 Ultimate SP1
CPU
Intel Core i5 9400 Coffee Lake 14nm
Motherboard
Asus Prime H310M-E R2.0 (LGA1151)
Memory
16G DDR4
Graphics Card(s)
NVidia GeForce GTX 960
Sound Card
Realtek High Definition Audio (mobo)
Monitor(s) Displays
Asus PA248 24" 16:10 format
Screen Resolution
1920x1200@59Hz
Hard Drives
1863GB Seagate ST2000DM
3726GB Seagate ST4000DM
1863GB Seagate ST2000DM
6TB Seagate
465GB NVMe Samsung SSD 970
PSU
750G2
Case
Tower
Cooling
Standard
Keyboard
USB
Mouse
USB
Internet Speed
920Mbs/480Mbs
Antivirus
Malwarebytes
Browser
Firefox
Thanks again, mate :-)

Ooops, spoke too soon :-)

The batch files work well (the Starter, anyway, haven't tried the Stopper) and I've placed shortcuts on the Taskbar*.

One question: When I ran the Starter bat (which immediately wrote its dummy text file to the USB HDD root) a blank command line window popped up. Is it possible to avoid this?
If not, no BFD.

*BTW, I've been employing the 'Taskbar Shortcuts' workaround ever since I've been using W7, so putting batch file shortcuts there was no problem.

And, seeing as I prefer the look of a squarer screen on my 24" 16:10 monitor, I've moved the Taskbar to the right side and made it four shortcut icons wide. So my useable screen is now 325mm x 475mm wide instead of the native 520mm width.
 
Last edited:

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
My build
OS
Win7 Ultimate SP1
CPU
Intel Core i5 9400 Coffee Lake 14nm
Motherboard
Asus Prime H310M-E R2.0 (LGA1151)
Memory
16G DDR4
Graphics Card(s)
NVidia GeForce GTX 960
Sound Card
Realtek High Definition Audio (mobo)
Monitor(s) Displays
Asus PA248 24" 16:10 format
Screen Resolution
1920x1200@59Hz
Hard Drives
1863GB Seagate ST2000DM
3726GB Seagate ST4000DM
1863GB Seagate ST2000DM
6TB Seagate
465GB NVMe Samsung SSD 970
PSU
750G2
Case
Tower
Cooling
Standard
Keyboard
USB
Mouse
USB
Internet Speed
920Mbs/480Mbs
Antivirus
Malwarebytes
Browser
Firefox
Back
Top