Executing ls command from a batch file

FAQ, getting help, user experience about Primo Ramdisk
Post Reply
PhilRack
Level 2
Level 2
Posts: 5
Joined: Fri May 11, 2012 2:50 pm

Executing ls command from a batch file

Post by PhilRack »

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
User avatar
Support
Support Team
Support Team
Posts: 3623
Joined: Sun Dec 21, 2008 2:42 am

Re: Executing ls command from a batch file

Post by Support »

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".
PhilRack
Level 2
Level 2
Posts: 5
Joined: Fri May 11, 2012 2:50 pm

Re: Executing ls command from a batch file

Post by PhilRack »

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.
User avatar
Support
Support Team
Support Team
Posts: 3623
Joined: Sun Dec 21, 2008 2:42 am

Re: Executing ls command from a batch file

Post by Support »

PhilRack wrote: Thu Nov 28, 2019 5:39 pm I have to change to the current drive and issue a CD command before executing the rxprd.exe xxx command.
I checked again and don't see these steps are required before executing rxprd.exe. Perhaps some other things caused this issue?
Post Reply