Can I clear an NCache cache without confirmation?

461 Views Asked by At

I've got an NCache implementation (configured in replicated format across a pair of servers, if that makes any difference) and I want to script clearing the cache. I've got a powershell script that calls the NCache clearcache.exe tool (in \bin\tools) with the appropriate parameters, but the tool then prompts me for confirmation that I actually do want to clear a non-empty cache (why yes, I do!).

I've looked at the inline help for the command (scanty) and in the NCache documentation online (http://www.alachisoft.com/resources/docs/ncache/help/main.html) without any luck for help with additional parameters (like a --force option or the like).

Is there any such option that would allow me to clear the cache without having to interact with the script? Is there another path to accomplishing the same thing?

2

There are 2 best solutions below

1
On BEST ANSWER

If you look at page 35 here (NCache Command Line Tools guide), you'll see that you can use /F to force a clear cache.

4
On

Open CMD and go to NCache installation folder then bin/tools For me it's C:\Program Files\NCache\bin\tools

run clearcache.exe /? you'll get

C:\Program Files\NCache\bin\tools>clearcache.exe /?

Alachisoft (R) NCache Utility ClearCache. Version 4.6.0.0 
Copyright (C) Alachisoft 2015. All rights reserved.

Usage: clearcache cache-name [option[...]].

Argument:

cache-name(s)

Specifies one or more name(s) of caches separated by space registered on
the server. The cache(s) with this/these name(s) is/are started on the
server. Note: Space-separated cache names are to be specified in case of
multiple caches.

Option:

/w /webcontent (Only avaiable in Enterprise edition)
Clear Javascript and CSS only.

/F /forceclear

Force the clearing of the cache. If not specified, the user is asked before
clearing the cache.

/G /nologo

Suppresses display of the logo banner.

/?

Displays a detailed help screen

so run clearcache with the /F or in full form /forceclearoption