Announcement

Collapse
No announcement yet.

start shortcut from .bat

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • start shortcut from .bat

    I have shortcut that I need to run from batch. Searched the web, saw couple of examples not very clear.
    Could somebody provide clear syntax in .bat?

    Also, I know that Shorcuts have .lnk extention. Is it normal that extention doesn't appear in the explorer when file extentions are unhidden.
    The type for the file shown Shortcut. Why the .lnk not show up (just for the info).
    "When you hit a wrong note it's the next note that makes it good or bad". Miles Davis

  • #2
    Have a read of this and see if it helps.
    1 1 was a racehorse.
    2 2 was 1 2.
    1 1 1 1 race 1 day,
    2 2 1 1 2

    Comment


    • #3
      unfortunately, it is a different question....
      Mine is not about a shortcut placement but launching a shortcut from a batch file.
      Would like to have this thingy work...
      "When you hit a wrong note it's the next note that makes it good or bad". Miles Davis

      Comment


      • #4
        A shortcut is a "shortcut" to an object ( a file, an executable, a website, etc.). I don't understand what you mean when you say that you want to "launch a shortcut". Why aren't you launching the target of the shortcut directly instead of trying to "launch" the shortcut?

        Comment


        • #5
          because there is no way to publish a shortcut in the GUI of RemoteApp. Only a program (so .bat is fine)
          The Executable is on server. But Start in is a local Path (yes Legacy app).

          So, if I will have .bat with the syntax that will launch the shortcut - simulation a click, I can publish the thing.
          Yes there is a powershell command for publishing but it not works for shortcut (some people saying it works).
          So trying to find a work around.
          "When you hit a wrong note it's the next note that makes it good or bad". Miles Davis

          Comment


          • #6
            Are group policy preferences an option for you?
            Tom Jones
            MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
            PhD, MSc, FIAP, MIITT
            IT Trainer / Consultant
            Ossian Ltd
            Scotland

            ** Remember to give credit where credit is due and leave reputation points where appropriate **

            Comment


            • #7
              non desirable.. but if for Computers... I can try. In my case it should be applied on 4 RDSH hosts and shortcut should be constantly available, because it will be pubslished as a RemoteAPP.
              "When you hit a wrong note it's the next note that makes it good or bad". Miles Davis

              Comment


              • #8
                Ok, I just typed up a lot of words only to find I was confusing myself. I is not any good at scripting and have obviously misunderstood what you are trying to accomplish. Can you describe fully what and how you want to run this program. Fake names to protect the guilty can be used.


                1 1 was a racehorse.
                2 2 was 1 2.
                1 1 1 1 race 1 day,
                2 2 1 1 2

                Comment


                • #9
                  Imagine

                  1. a shortcut to notepad.exe on desktop

                  2. the notepad should be started from batch file that will launch the shortcut to notepad.exe
                  "When you hit a wrong note it's the next note that makes it good or bad". Miles Davis

                  Comment


                  • #10
                    Where is the launching bat file located?
                    Is it to be an automatic launch, say when you logon, or a launch as/when required?
                    1 1 was a racehorse.
                    2 2 was 1 2.
                    1 1 1 1 race 1 day,
                    2 2 1 1 2

                    Comment


                    • #11
                      c:\file.bat
                      it will be used by other program and presented to a user which will execute this bat when needed.
                      "When you hit a wrong note it's the next note that makes it good or bad". Miles Davis

                      Comment


                      • #12
                        I wish I got paid the same as a dentist.

                        So, how does this other app know when it needs to open "notepad"?
                        1 1 was a racehorse.
                        2 2 was 1 2.
                        1 1 1 1 race 1 day,
                        2 2 1 1 2

                        Comment


                        • #13
                          there was a question above what I need it for.... I explained...

                          Look at this as general question: is it possible to launch a shortcut from the batch file? Some people on web did it. Not always worked... I asked here because many times got help on Petri.co...

                          here is what I described earlier. I need it for RemoteAPP if you tried it you can follow the need... if not forget ... but generally I need to do that seems doable and I asked it on general Scripting part :
                          of the forum:

                          because there is no way to publish a shortcut in the GUI of RemoteApp. Only a program (so .bat is fine)
                          The Executable is on server. But Start in is a local Path (yes Legacy app).

                          So, if I will have .bat with the syntax that will launch the shortcut - simulation a click, I can publish the thing.
                          Yes there is a powershell command for publishing but it not works for shortcut (some people saying it works).
                          So trying to find a work around.

                          some offer to do in batch:
                          rundll32 shell32.dll,ShellExec_RunDLL "C:\prog.lnk"
                          http://www.computing.net/answers/pro...ile/16269.html
                          "When you hit a wrong note it's the next note that makes it good or bad". Miles Davis

                          Comment


                          • #14
                            there was a question above what I need it for.... I explained...
                            In our world of TCP, when a message is sent and isn't received correctly then the receiver asks for that message to be retransmitted. It is the RESPONSIBILITY of the sender to make sure that the message is UNDERSTOOD. Your miniscule answers to questions asked makes it bloody difficult to understand what you are trying to say.

                            I wish you well with your endeavour.
                            1 1 was a racehorse.
                            2 2 was 1 2.
                            1 1 1 1 race 1 day,
                            2 2 1 1 2

                            Comment


                            • #15
                              Like Joe mentioned earlier, instead of trying to launch a shortcut from a batch, you should be launching the program from the batch.
                              e.g. You have a batch that is trying to launch the "notepad shortcut"
                              Code:
                              start C:\NotepadShortcut.lnk
                              In the shortcut you have the path to the program, maybe some parameters, and a starting directory.
                              In your batch file, you should just do this:
                              Code:
                              start "My title" /D C:\Windows C:\Windows\notepad.exe C:\sometextfile.txt
                              Regards,
                              Jeremy

                              Network Consultant/Engineer
                              Baltimore - Washington area and beyond
                              www.gma-cpa.com

                              Comment

                              Working...
                              X