Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. the Registry and DOS commands

the Registry and DOS commands

Scheduled Pinned Locked Moved C#
databasetutorialsql-serversysadminwindows-admin
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Antonio JVS
    wrote on last edited by
    #1

    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?

    M S L 3 Replies Last reply
    0
    • A Antonio JVS

      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?

      M Offline
      M Offline
      Md Marufuzzaman
      wrote on last edited by
      #2

      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.

      A 1 Reply Last reply
      0
      • A Antonio JVS

        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?

        S Offline
        S Offline
        S Brozius
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0
        • A Antonio JVS

          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?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          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

          A 1 Reply Last reply
          0
          • M Md Marufuzzaman

            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.

            A Offline
            A Offline
            Antonio JVS
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • L Lost User

              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

              A Offline
              A Offline
              Antonio JVS
              wrote on last edited by
              #6

              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.

              L 1 Reply Last reply
              0
              • A Antonio JVS

                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.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                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![^]

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups