I write a Windows application that needs to have some "secret" functionality. For example, the application disables certain parts of the UI if the user is running in a certain environment. But because of corporate security measures, actually testing in that environment is inconvenient. (We have to request that it be set up, and then wait for the helpdesk to do so, and this can take a while. And then if there's a bug that I fix, we have to do it all again to retest. Yes, this is very frustrating.)

So I have a mode that simulates running in that environment. We test in the simulation, get out all the bugs, and only deploy to the special environment at the end, just to confirm that it still works in the real environment.

The question is how to get into that special mode. It can't be something that you invoke in the app, because by then the app has loaded, and it's too late.

For now, I have a secret key that you hold down and then invoke the app. This works, but is confusing because people seem to have trouble knowing how to operate it; they'll press an let go, and then the key isn't down when the relevant code checks for the key.

I could require the presence of a special file, but that's more effort and if they leave the file behind, it'll stay in that mode unintentionally. Or I could make it a command line argument, but then again you would have to invoke the app in a somewhat careful way (like via the command line or a special shortcut).

Is there a better way to provide this kind of startup signal to an app, without external dependencies?

  • 1
    You've dismissed the command-line argument with a dedicated shortcut without really explaining why. It's hard to give you advice without understanding your requirements. Personally I think a command-line argument with a dedicated shortcut would be the best approach: it's explicit, likely to be self-documenting, and hard to trigger accidentally.
    – jamesdlin
    Jan 8, 2022 at 7:45

2 Answers 2


More Context Please

people seem to have trouble knowing how to operate it

Who are these people?

they'll press an let go, and then the key isn't down when the relevant code checks for the key.

How and what instructions were provided?

A man looking at instructions


Press the shift key before you launch the app, and hold it until the app has loaded.

seems like something most people will be able to understand/follow.

But you may want to front-load the "hold", so this is probably better:

Press and hold the shift key, then launch the app; you can release the key once the app has loaded.

Similar Scenario

Apple's instructions on how to reset NVRAM:

Apple instructions on how to reset NVRAM

The key combination here is a clear design choice to prevent anyone doing this by accident.

Note the section on audio feedback; Let the user know their request has been registered and saves them having to hold the key longer than needed.


Whilst more context is needed, based on the information provided I can't think of many better ways to do this.


This doesn’t sound like a UX problem to me.

Testing on different environments is a very common scenario in software development and is often best handled by a programmer that creates a separate debug build that makes it easy for the team to test on different environments. The debug version could even have a nice popup that allows you to simply select the environment you want to test on. The release version of the software that is shipped to customers should not include this kind of code at all.

That said, it seems like there are a few ways to implement secret functionality. You came up with a few good ones yourself:

  • Secret key press during start up
  • Presence of a certain file
  • Command line parameter

Brainstorming a bit, here are some more suggestions:

  • Use details about currently logged in user to make it easy for your team to select environment
  • Presence of an Environment variable
  • Presence of a Windows Registry entry
  • Presence of a specific resource on the local network

If you can't solve this problem with a debug build, I personally think having a command line parameter and creating a special shortcut to your application sounds like a good approach.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.