Page 1 of 1

Weird Command line Behavior

Posted: Sun Jun 05, 2022 1:14 pm
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

Re: Weird Command line Behavior

Posted: Sun Jun 05, 2022 1:46 pm
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.

Re: Weird Command line Behavior

Posted: Mon Jun 06, 2022 3:05 am
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