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