I'm struggling with trying to execute the ls command from a CMD file to run as a batch job. Specifically, I'm trying to direct output to a text file.
This is on Windows 10 Pro. Here's what I've been trying but to no avail.
@ECHO ON
CLS
SETLOCAL ENABLEEXTENSIONS
"C:\Program Files\Primo Ramdisk\rxprd.exe" ls > c:\temp\myfileinfo.txt
Pause
EXIT
Any suggestions would be welcomed! Note, I can manually open a command window and run the command rxprd.exe > c:\temp\myfileinfo.txt and it works fine.
Phil
Executing ls command from a batch file
Re: Executing ls command from a batch file
You need to run the batch file with administrative privileges. The easiest way is to create a shortcut on this batch file, and then right click the shortcut file, choose "Properties", then "Shortcut" - "Advanced...", and then check the option "Run as administrator".
Re: Executing ls command from a batch file
Thanks. I also discovered another issue. And that is I have to change to the current drive and issue a CD command before executing the rxprd.exe xxx command.
@ECHO ON
CLS
SETLOCAL ENABLEEXTENSIONS
C:
CD\
"C:\Program Files\Primo Ramdisk\rxprd.exe" ver > D:\WPSWORK\_TD29980\vdriveversion.txt
EXIT
p.s. This is absolutely great software! I love your products.
@ECHO ON
CLS
SETLOCAL ENABLEEXTENSIONS
C:
CD\
"C:\Program Files\Primo Ramdisk\rxprd.exe" ver > D:\WPSWORK\_TD29980\vdriveversion.txt
EXIT
p.s. This is absolutely great software! I love your products.