the Registry and DOS commands
-
Anyone knows how to handle (read/write) the registry to search for a path, and how to send DOS commands for example to send SQL commands to attach and dettach a database from the SQL server?
-
Anyone knows how to handle (read/write) the registry to search for a path, and how to send DOS commands for example to send SQL commands to attach and dettach a database from the SQL server?
Antonio JVS wrote: example to send SQL commands to attach and dettach a database from the SQL server? Quote Selected Text Try the following: SQL Express Command-Line Utility
Thanks Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you. I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
-
Anyone knows how to handle (read/write) the registry to search for a path, and how to send DOS commands for example to send SQL commands to attach and dettach a database from the SQL server?
For reading the registry, Windows XP and up provide the DOS-tool REG.EXE, with which you can read AND write registry-keys.
Nah... What's up, Doc? CCC's solved : 1 If a bus station is where a bus stops, and a train station is where a train stops, why do I have a work station on my desk?
-
Anyone knows how to handle (read/write) the registry to search for a path, and how to send DOS commands for example to send SQL commands to attach and dettach a database from the SQL server?
There are registry classes that you can use to interact with the registry. See this link.[^] To issue DOS commands you can write a batch file on the fly and then execute it. Here are some more relevant classes / enumerations for registry interaction Registry Class Link[^] RegistryHive Enumeration Link[^] RegistryKey Class Link[^] RegistryKeyPermissionCheck Enumeration Link[^] RegistryValueKind Enumeration Link[^] RegistryValueOptions Enumeration Link[^]
Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]
modified on Monday, December 14, 2009 9:37 AM
-
Antonio JVS wrote: example to send SQL commands to attach and dettach a database from the SQL server? Quote Selected Text Try the following: SQL Express Command-Line Utility
Thanks Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you. I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
Just need to send DOS commands like "sqlcmd -S ..." to register a database in the SQL and use it in the path it puts it, I'm in the begining of my application and see the best way to use the database.
-
There are registry classes that you can use to interact with the registry. See this link.[^] To issue DOS commands you can write a batch file on the fly and then execute it. Here are some more relevant classes / enumerations for registry interaction Registry Class Link[^] RegistryHive Enumeration Link[^] RegistryKey Class Link[^] RegistryKeyPermissionCheck Enumeration Link[^] RegistryValueKind Enumeration Link[^] RegistryValueOptions Enumeration Link[^]
Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]
modified on Monday, December 14, 2009 9:37 AM
thaks it did help, just don't know how to create a batch file on the fly and execute it I'm new to C# and never used it on VB.
-
thaks it did help, just don't know how to create a batch file on the fly and execute it I'm new to C# and never used it on VB.
I suggest you get a begginners book and start from chapter one, this would fall under basic IO functions and then using the systems.diagnostics.process class to execute the batch file you created.
Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]