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 / C++ / MFC
  4. NT Service - working directory

NT Service - working directory

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
5 Posts 5 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.
  • Y Offline
    Y Offline
    yoti11
    wrote on last edited by
    #1

    Hello, How can change the working directory of NT service from WINNT\system32 to the exe directory (C++ unmanaged)? Thanks,

    M D V H 4 Replies Last reply
    0
    • Y yoti11

      Hello, How can change the working directory of NT service from WINNT\system32 to the exe directory (C++ unmanaged)? Thanks,

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      SetCurrentDirectory()

      --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

      1 Reply Last reply
      0
      • Y yoti11

        Hello, How can change the working directory of NT service from WINNT\system32 to the exe directory (C++ unmanaged)? Thanks,

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Use GetModuleFileName(NULL, ...) to get the EXE's folder. Use that with SetCurrentDirectory().


        "Money talks. When my money starts to talk, I get a bill to shut it up." - Frank

        "Judge not by the eye but by the heart." - Native American Proverb

        1 Reply Last reply
        0
        • Y yoti11

          Hello, How can change the working directory of NT service from WINNT\system32 to the exe directory (C++ unmanaged)? Thanks,

          V Offline
          V Offline
          Vipin Aravind
          wrote on last edited by
          #4

          If you are bent at using crt routines, then _chdir would do that. Be aware that this routine would internally call the win32 api, SetCurrentDirectory.

          Vipin Aravind - MVP

          1 Reply Last reply
          0
          • Y yoti11

            Hello, How can change the working directory of NT service from WINNT\system32 to the exe directory (C++ unmanaged)? Thanks,

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            See SetCurrentDirectory(for set directory) GetCurrentDirectory(for get current directory)

            _**


            **_

            WhiteSky


            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