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. executing .bat file in Vista64 bit

executing .bat file in Vista64 bit

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

    Hi All, In my application I need to execute some commands. For that I am making a .bat file and execute it using Shellexecute(). It is working well for Vista32 bit, but in Vista64 bit machine Shellexecute() is not running these commands(i am running with Admin privileges also). Does ShellExecute() not support Vista64 bit? Is there any other way for Vista64 bit. Thanks Madan

    _ L D 3 Replies Last reply
    0
    • M Madan Chauhan

      Hi All, In my application I need to execute some commands. For that I am making a .bat file and execute it using Shellexecute(). It is working well for Vista32 bit, but in Vista64 bit machine Shellexecute() is not running these commands(i am running with Admin privileges also). Does ShellExecute() not support Vista64 bit? Is there any other way for Vista64 bit. Thanks Madan

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      It's probably some error in your batch file. First run the batch file manually and check if all the commands work.

      «_Superman_» I love work. It gives me something to do between weekends.

      M 1 Reply Last reply
      0
      • M Madan Chauhan

        Hi All, In my application I need to execute some commands. For that I am making a .bat file and execute it using Shellexecute(). It is working well for Vista32 bit, but in Vista64 bit machine Shellexecute() is not running these commands(i am running with Admin privileges also). Does ShellExecute() not support Vista64 bit? Is there any other way for Vista64 bit. Thanks Madan

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

        Hi Madan, Are you using the undocumented runas verb to request elevation? Elevate through ShellExecute[^] Best Wishes, -David Delaune

        1 Reply Last reply
        0
        • _ _Superman_

          It's probably some error in your batch file. First run the batch file manually and check if all the commands work.

          «_Superman_» I love work. It gives me something to do between weekends.

          M Offline
          M Offline
          Madan Chauhan
          wrote on last edited by
          #4

          Thanks for replying. Yes all the commands are correct because if I run this batch file with command prompt then it execute successfully. Let me explain- I am running following three commands command1)- bcdedit /set {bootmgr} device boot > D:\m1.txt command2)- bcdedit /set {default} device boot > D:\m3.txt command3)- bcdedit /set {default} osdevice boot > D\m2.txt. These three commands clears Bootmgr of Vista. For runnong these commands I make a batch file and execute it with ShellExecute() For seeing output I used pipe. Then after ShellExecute() if I see these m1,m2,m3 files then these are blank. I am confused now.

          1 Reply Last reply
          0
          • M Madan Chauhan

            Hi All, In my application I need to execute some commands. For that I am making a .bat file and execute it using Shellexecute(). It is working well for Vista32 bit, but in Vista64 bit machine Shellexecute() is not running these commands(i am running with Admin privileges also). Does ShellExecute() not support Vista64 bit? Is there any other way for Vista64 bit. Thanks Madan

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

            Madan Chauhan wrote:

            ...but in Vista64 bit machine Shellexecute() is not running these commands(i am running with Admin privileges also).

            What does it return?

            "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            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