Weird Command line Behavior

FAQ, getting help, user experience about PrimoCache
Post Reply
Mingyuan
Level 3
Level 3
Posts: 10
Joined: Mon Jul 26, 2021 7:17 am

Weird Command line Behavior

Post by Mingyuan »

I am trying to write a .bat file to manage my cache tasks. It pauses or resumes cache tasks and append a log to a txt file for debugging.
To debug it, I configure it to write to the log 1: whether the process is run as admin, 2: exit code of the rxpcc command, 3: time stamp.

The following behaviors are seen:

1. manually type the pause command in a cmd prompt with admin privileges >> cache paused successfully.
2. run the bat file as admin >> cache paused successfully, the log shows admin privileges detected.
3. run the bat file not as admin >> cache not paused, the log shows admin privileges not detected.
4. call the bat file from a program on run not by admin >> cache not paused, the log shows admin privileges not detected.
5. call the bat file from a program on run by admin >> cache not paused, the log shows admin privileges detected.

In all cases above the exit code is 0.

How should I properly stop primocache
Mingyuan
Level 3
Level 3
Posts: 10
Joined: Mon Jul 26, 2021 7:17 am

Re: Weird Command line Behavior

Post by Mingyuan »

Update

I made a work-around by wrapping each command into a scheduled task that only fires on demand. But still figuring out how to get the commandline working will be greatly helpful.
User avatar
Support
Support Team
Support Team
Posts: 3623
Joined: Sun Dec 21, 2008 2:42 am

Re: Weird Command line Behavior

Post by Support »

PrimoCache CLI will return an exit code of 0 if the command was executed successfully, 2 if the command line inputs were invalid, 3 if the command failed, or 4 if the user canceled the command.
I guess the exit code you saw was not from the PrimoCache CLI, but your last custom command.

And below link is for your information.
viewtopic.php?t=4738
Post Reply