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. WinExec

WinExec

Scheduled Pinned Locked Moved C / C++ / MFC
9 Posts 4 Posters 4 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.
  • U Offline
    U Offline
    Usman Tasleem Akshaf
    wrote on last edited by
    #1

    i want to know is there any function or system call which is generalized and can run any file given as a parameter.i have tried WinExec("c:/one.exe",SW_SHOW) . This system call works perfect for executable files but when i try to give a zip file as its first parameter it doesn't execute it.Is there any system call which is generalized one and can run any file . Be FaithFull To Your Work.

    B 1 Reply Last reply
    0
    • U Usman Tasleem Akshaf

      i want to know is there any function or system call which is generalized and can run any file given as a parameter.i have tried WinExec("c:/one.exe",SW_SHOW) . This system call works perfect for executable files but when i try to give a zip file as its first parameter it doesn't execute it.Is there any system call which is generalized one and can run any file . Be FaithFull To Your Work.

      B Offline
      B Offline
      berndg
      wrote on last edited by
      #2

      You're looking at ShellExecute(). Or, you should be.

      U 1 Reply Last reply
      0
      • B berndg

        You're looking at ShellExecute(). Or, you should be.

        U Offline
        U Offline
        Usman Tasleem Akshaf
        wrote on last edited by
        #3

        currently i am sitting on a computer which doesn't have vs 6.so you just tell me does ShellExecute() run any type of file and is it a generalized one and what is the description of its parameters.Thanks Be FaithFull To Your Work.

        L B T 3 Replies Last reply
        0
        • U Usman Tasleem Akshaf

          currently i am sitting on a computer which doesn't have vs 6.so you just tell me does ShellExecute() run any type of file and is it a generalized one and what is the description of its parameters.Thanks Be FaithFull To Your Work.

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

          It is the same as the 'Open' item on the menu if you right click on a file, it uses the default action on that file type. I have used this on Word documents and Excel spreadsheets. Elaine :rose: The tigress is here :-D

          U 1 Reply Last reply
          0
          • U Usman Tasleem Akshaf

            currently i am sitting on a computer which doesn't have vs 6.so you just tell me does ShellExecute() run any type of file and is it a generalized one and what is the description of its parameters.Thanks Be FaithFull To Your Work.

            B Offline
            B Offline
            berndg
            wrote on last edited by
            #5

            You may not have VS, but you have the Internet[^]. ShellExecute performs verbs on an object. This can be "open" (verb) abc.zip (object), or "print" zorro.doc - anything that is registered within the local system. Your application need not even know what the application is; and it will automatically use the user's default application. For instance, "edit" readme.txt will laucnh that file in the user's preferred editor for txt file.

            U 1 Reply Last reply
            0
            • L Lost User

              It is the same as the 'Open' item on the menu if you right click on a file, it uses the default action on that file type. I have used this on Word documents and Excel spreadsheets. Elaine :rose: The tigress is here :-D

              U Offline
              U Offline
              Usman Tasleem Akshaf
              wrote on last edited by
              #6

              Thanks buddy.BUT WHAT ABOUT THE PARAMETER LIST.DOES IT TAKE JUST PATH OF FILE OR SOMETHING ELSE AS WELL. Be FaithFull To Your Work.

              L 1 Reply Last reply
              0
              • B berndg

                You may not have VS, but you have the Internet[^]. ShellExecute performs verbs on an object. This can be "open" (verb) abc.zip (object), or "print" zorro.doc - anything that is registered within the local system. Your application need not even know what the application is; and it will automatically use the user's default application. For instance, "edit" readme.txt will laucnh that file in the user's preferred editor for txt file.

                U Offline
                U Offline
                Usman Tasleem Akshaf
                wrote on last edited by
                #7

                AS SOON AS I HAVE POSTED MY LAST POST ,I REALISED MY MISTAKE AND WENT STRAIGHT TO THE LINK YOU HAVE GIVEN.SORRY AND THANKS . Be FaithFull To Your Work.

                1 Reply Last reply
                0
                • U Usman Tasleem Akshaf

                  Thanks buddy.BUT WHAT ABOUT THE PARAMETER LIST.DOES IT TAKE JUST PATH OF FILE OR SOMETHING ELSE AS WELL. Be FaithFull To Your Work.

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

                  It's in the documentation,go to Help ->Index. The tigress is here :-D

                  1 Reply Last reply
                  0
                  • U Usman Tasleem Akshaf

                    currently i am sitting on a computer which doesn't have vs 6.so you just tell me does ShellExecute() run any type of file and is it a generalized one and what is the description of its parameters.Thanks Be FaithFull To Your Work.

                    T Offline
                    T Offline
                    toxcct
                    wrote on last edited by
                    #9

                    Usman Tasleem Akshaf wrote: currently i am sitting on a computer which doesn't have vs 6. i don't see where is the problem... MSDN have an inline web site... the url for Visual C++ is www.msdn.microsoft.com/visualc there, search for ShellExecute()[^]... not so hard to do by yourself isn't it ? :->


                    TOXCCT >>> GEII power
                    [toxcct][VisualCalc]

                    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