All but... can be used when we know what( the quantity) we are talking about.
eg. I have 10 different candies and you can have all but one that is marked red.
Anything but... can be used when we dont have a definite quantity/ things. This is usage has more of a negative tone .
eg. I can work on anything but this project.
Everything but ..... similar in usage with anything but ...... but with a positive tone..
Could not but ..... there was no other way other than doing a/an thing/action
eg. He could not but stop laughing at his wife's folly.