Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: another question  (Read 6991 times)

0 Members and 1 Guest are viewing this topic.

BatchRocks



    Hopeful
  • Thanked: 3
    Re: another question
    « Reply #15 on: January 07, 2009, 04:46:39 PM »
    Very well, Tan. But one question, can it only open things in Notepad/Wordpad and what's the 'Path of File'? I just skip that, LOL.

    Tan_Za



      Intermediate
    • Starcraft and C programming
      • Experience: Experienced
      • OS: Windows 7
      Re: another question
      « Reply #16 on: January 07, 2009, 05:02:24 PM »
      Umm you can open your program with anything if you just read the line input it should tell you enough, but yes say if you wanted to open a delphi source file and you were using this method you could type 'C:\delphi\delphi9' as ch1 and 'C:\program\' as ch2 and the your document as ch3, so you know I named the vars ch1, ch2, ch3 because I couldn't care less as in writing something longer than 3 characters.

      Tan_Za

      Helpmeh



        Guru

      • Roar.
      • Thanked: 123
        • Yes
        • Yes
      • Computer: Specs
      • Experience: Familiar
      • OS: Windows 8
      Re: another question
      « Reply #17 on: January 08, 2009, 02:28:00 PM »
      If you know the internal name of the file, winword for example, you can do this:

      Winword "%path%\%file%"

      Which would open the chosen file with Microsoft word.
      Where's MagicSpeed?
      Quote from: 'matt'
      He's playing a game called IRL. Great graphics, *censored* gameplay.

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: another question
      « Reply #18 on: January 08, 2009, 02:31:53 PM »
      the neat part of tan_za's code, is if you don't give a executable name, It automatically opens the file with the default program.
      But if you wanted to force it to open in another prog, you can.
      I was trying to dereference Null Pointers before it was cool.

      Tan_Za



        Intermediate
      • Starcraft and C programming
        • Experience: Experienced
        • OS: Windows 7
        Re: another question
        « Reply #19 on: January 08, 2009, 04:54:29 PM »
        I can not belive that you found that out but oh well, yes you can open any program with any other program as long as you know what program you want to open and what you what to open it with. If you don't then you would have to learn, but I think everybody here understands how it all works.

        Tan_Za

        BC_Programmer


          Mastermind
        • Typing is no substitute for thinking.
        • Thanked: 1140
          • Yes
          • Yes
          • BC-Programming.com
        • Certifications: List
        • Computer: Specs
        • Experience: Beginner
        • OS: Windows 11
        Re: another question
        « Reply #20 on: January 08, 2009, 05:10:56 PM »
        I can not belive that you found that out but oh well

        What's that supposed to mean?  ??? I wasn't saying you can specify a particular executable, the main thing I was saying was that you can give a blank entry for the executable.


        If you know the internal name of the file, winword for example, you can do this:

        Winword "%path%\%file%"

        Which would open the chosen file with Microsoft word.

        Winword, Excel, Powerpnt, and so forth only work without an explicit path because the installer creates a new AppPath entry in the registry.

        For example, even with the internal name of a program that doesn't, say,  Visual Basic 6 (VB6.EXE), trying to run "VB6" on the command line won't work.

        Almost all Office programs implement the addition to the appPath key (SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths), and many other programs do. But, if ever this method fails, the reason is that the executable is not in the AppPaths key.
        I was trying to dereference Null Pointers before it was cool.

        Tan_Za



          Intermediate
        • Starcraft and C programming
          • Experience: Experienced
          • OS: Windows 7
          Re: another question
          « Reply #21 on: January 08, 2009, 05:23:33 PM »
          Yes that is correct and if you want to beable to do what office does you can make your own path ways and shortcuts in the registary to make program you want to work, work.

          You can make your own registary via using regedit or some registary editing program or if you were samrt enough you could make your own program to do it for you.

          Tan_Za