c# - How do I handle the whitespaces of a registry path? -


i'm creating process in application makes possible run commands in command prompt.

when want export registry key, use reg export path file access registry key , export information file. if use path contains no whitespaces @ all, works fine. use path whitespaces, e.g. hkey_current_user\software\nvidia corporation, not work.

i'm appending path string stringbuilder command, string looks this: string path = "hkey_current_user\\software\\nvidia corporation".

do have change string contained in path? or there special static method can use format string?

you need surround path quotes. might help:

string path = "\"hkey_current_user\\software\\nvidia corporation\""; 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -