22 Replies Latest reply on Mar 27, 2008 2:13 PM by Peter Grainge

    Batch file execution

    Moonlion2 Level 1
      I have some batch files (.bat) that are referenced in my document. It would be keen to have a hyperlink that the user would click that would run the batch file for them right then and there.

      So far, all I have is a hyperlink that the user has to right-click then save as, then run the batch file off their desktop (or wherever). I created a folder via Project Manager and put the batch files in there, closed the project, then added the batch files to version control (Source Depot in our case) then opened the project in RH7 and there they were all hyperlinkable and everything.

      But that's only half a success.

      Is there a clever way to do this in RH7?


      And as a corollary question: What are baggage files? The online help is (not surprisingly) no use in definining what they are. Are they files that RH puts in there to make RH run, or are they things like my batch files, or both? And do baggage files have anything to do with what I'm trying to accomplish now?
        • 1. Re: Batch file execution
          MergeThis Level 4
          In the RH Help, enter "baggage" in the Search tab, Display the first topic "Adding Files to the Baggage Files Folder," and specifically read the second paragraph.


          Good luck,
          Leon
          • 2. Re: Batch file execution
            Moonlion2 Level 1
            Paragraph? You refer to this?
            quote:

            References to external elements may not add automatically to the Baggage Files folder. To add files manually:

            Select View > Pods > Project Manager. The Project Manager pod displays.
            Right-click the Baggage Files folder and select New Baggage File.
            Double-click the source file.
            Click Yes.
            I'm unclear how that text addresses the problem. There's no baggage folder in the Project Manager for me to right-click in the first place (thanks, RH7 help!) and it's not clear how that would make a difference anyway. When I go to hyperlink some text, none of the options in the "Link to:" pull-down include "baggage file." Is that because there's nothing in the baggage folder in the first place? I can of course select "file" and point to my batch file, which is how it's displaying at all and how the user can right-click it to download it, but like I say that's only half the way there...

            Also: What does this sentence mean? "Files are added to the Baggage Files folder so that are displayed correctly in the output:"

            Is that even a complete sentence? Files are added so that ... what are displayed? Correctly in the output of ... what?
            • 3. Re: Batch file execution
              Peter Grainge Adobe Community Professional (Moderator)
              Icon top left above Project Manager changes the view. That way they show up under Baggage Files. The new way, they show in the folder where the file is located.

              Highlight your text. Select the baggage file and drag to the text. Link created.

              • 4. Re: Batch file execution
                Moonlion2 Level 1
                I followed your instructions and, alas, the result is no different than what I did before (described above) with the simple hyperlinking. Your click-and-drag baggage link points to the file, sure, but clicking the link doesn't execute it and the user would still have to right-click and download it to their desktop (or wherever).


                P.S. Regarding the button that "toggles Project Manager view..." The title to the pod at the top and the highlighted tab at the bottom both say Project Manager. Um. What am I looking at when I'm in the Project Manager but have not toggled view project manager?
                • 5. Re: Batch file execution
                  Peter Grainge Adobe Community Professional (Moderator)
                  What sort of file are you linking to?

                  Both are Project Manager. One is the old view per previous versions and one is the new view. The latter shows images, topics etc all under the same folder. The old way was to show the folder structure several times over, one view with just images, one with just topics etc.

                  • 6. Re: Batch file execution
                    Level 2
                    It seems like we were looking at your "corollary question" without really answering it.

                    A baggage file is generally a file that you access through a script or some other way that wouldn't normally get included in your project the way an inserted image would.

                    That said, I don't think your problem is in your file not being added to baggage because you get the prompt to download it. I haven't worked with batch files but suspect they may work similarly to executables. If I put a direct hyperlink to something other than an HTML file, the browser may or may not be able to figure out what to do with it.

                    A few things you may want to look into are the "Shortcut control" which was designed to run executable files, and the "parser function," which Microsoft wrote to allow the browser (help engine, using IE components) to open various other file formats (such as pdf, doc, txt) within the help window.

                    John
                    • 7. Re: Batch file execution
                      Peter Grainge Adobe Community Professional (Moderator)
                      Thanks for picking that up John. So it's a batch file. I very much doubt you can run a batch file from a link as that is akin to linking to an exe and no browser is going to allow such a file to be run for security reasons.

                      Not sure but it would surprise me. Can someone else confirm for sure?

                      • 8. Re: Batch file execution
                        Moonlion2 Level 1
                        quote:

                        What sort of file are you linking to?
                        A batch file, as I said in the original post.
                        • 9. Re: Batch file execution
                          Moonlion2 Level 1
                          quote:

                          A baggage file is generally a file that you access through a script or some other way that wouldn't normally get included in your project the way an inserted image would.


                          At last, thanks very much for that information. That explains a lot right there.

                          quote:

                          If I put a direct hyperlink to something other than an HTML file, the browser may or may not be able to figure out what to do with it.
                          Quite right, which is why I was hoping that RH7 would have some sort of trick up its sleeve to address that very issue.

                          quote:

                          A few things you may want to look into are the "Shortcut control" which was designed to run executable files
                          Yes! This is exactly the kind of thing I was looking for, thank you very much.

                          This definitely looks like the right methodology for trying to do what I want. My difficulty is that I'm not sure what program I should choose to run the batch file. The closest I could come was to choose cmd.exe. Assuming that's the case, my next task is to figure out the proper command line text to insert into the "Program Parameters" box in the shortcut to have cmd.exe find and launch the batch file.

                          Even if that doesn't work at least I know I got to the right place to actually try--with your help. :) Thanks again!
                          • 10. Re: Batch file execution
                            Peter Grainge Adobe Community Professional (Moderator)
                            Aren't shortcut controls a CHM only thing? Moonlion: Aren't you producing webhelp?

                            If both are Yes, then we are back to what you are trying to do is run a batch file or exe from a browser and I doubt that can be done for security reasons.

                            • 11. Batch file execution
                              Moonlion2 Level 1
                              Ah, yes, webhelp is true.

                              I was hoping that RH7 would have, say, some kind of Javascript or something similar that it could insert that would allow such an execution anyhow.
                              • 12. Re: Batch file execution
                                Peter Grainge Adobe Community Professional (Moderator)
                                If anyone could produce something that breached the security, the security would be pointless.

                                • 13. Re: Batch file execution
                                  Moonlion2 Level 1
                                  I don't quite follow you since there are such things already, namely, Javascripts and ActiveX controls (from what I've read) that allow this very thing. But it's moot since RH7 doesn't have anything I'll have to do it myself, I guess.
                                  • 14. Re: Batch file execution
                                    Peter Grainge Adobe Community Professional (Moderator)
                                    You want the batch file. A batch file could contain del*.* As I understand it, Javascript is limited to what it can and cannot do and that would be one thing it cannot do. So Javascript is limited and permitted, running a batch file or an exe is not.

                                    What is the ultimate objective of the batch file?

                                    • 15. Re: Batch file execution
                                      Moonlion2 Level 1
                                      quote:

                                      What is the ultimate objective of the batch file?
                                      A variety of things that are far outside the scope of this forum.

                                      Aside from that and a pointless debate about computer security and the potentiality of Javascript and ActiveX, RH7 isn't going to help with this problem so this topic is pretty much closed.
                                      • 16. Re: Batch file execution
                                        Peter Grainge Adobe Community Professional (Moderator)
                                        Sure hope you land them safely on the moon.

                                        OK, I'll stay away from your future posts to avoid irritating you.

                                        If you do get a batch file or an exe to work from a link, please post back how you did it for the benefit of others.

                                        • 17. Re: Batch file execution
                                          MergeThis Level 4
                                          Sorry, I was referencing the X5 help. However, I suspect that entering that search term should have pointed you to a similar topic with an explanation of baggage files (as John McCallum said, anything that's not linked in a topic with either <a href=etc.> or <img src=etc.> is a candidate).


                                          Good luck,
                                          Leon
                                          • 18. Re: Batch file execution
                                            Moonlion2 Level 1
                                            quote:

                                            Sure hope you land them safely on the moon.
                                            I honestly don't know what that expression means.
                                            quote:

                                            OK, I'll stay away from your future posts to avoid irritating you.
                                            There's no need to overrreact.
                                            The only thing I found irritating was having to re-state that I was talking about a batch file. I'll explain: That I was referring to a batch file was not only mentioned in the first sentence of the topic but repeated five more times later in the same post for a total of six times. "Batch file execution" is the title of the topic on top of everything else.

                                            So my perspective is this: After naming the topic batch file execution and mentioning batch file six times in the same post your response was: "What sort of file are you linking to?"

                                            I hope you can see why this is frustrating. Whether or not you ever reply to anything is of course up to you--I would just suggest that you read the poster's query more carefully to avoid having to ask such questions in the future.
                                            • 19. Re: Batch file execution
                                              Moonlion2 Level 1
                                              quote:

                                              Sorry, I was referencing the X5 help. However, I suspect that entering that search term should have pointed you to a similar topic with an explanation of baggage files
                                              Nope. Searching for "baggage file" returned 22 topics. None of them define what in the world baggage file means as clearly and succinctly as Mr. McCallum's explanation.

                                              It's hyperbole to say that RH7's own help continues to disappoint at every turn, but not by much.
                                              • 20. Re: Batch file execution
                                                Peter Grainge Adobe Community Professional (Moderator)
                                                You said "A variety of things that are far outside the scope of this forum." If it is so far beyond us, I guessed you were trying to get a man on the moon.

                                                Yes I asked what sort of file and then John posted and I immediately corrected things. I was trying to fix someone's horrible import problems and trying to post to the forum at the same time. Just sometimes after a long day in the office, it is easy to miss a detail that was covered. I'm UK based so that reply was given during my evening.

                                                You also said "Aside from that and a pointless debate about computer security and the potentiality of Javascript and ActiveX, RH7 isn't going to help with this problem so this topic is pretty much closed. That sounded more like you were getting rattled about me saying that it was a security thing and that I thought it unlikely you would get a batch file to run. It also sounded like a way of saying you didn't want to hear any more on the subject.

                                                Maybe you are looking at the Adobe logo against my name and thinking I work for them. The Adobe Community Experts are people doing the same job as you and then giving of their own time. They are not Adobe employees and not paid for responding to posts.

                                                • 21. Re: Batch file execution
                                                  Moonlion2 Level 1
                                                  quote:

                                                  You said "A variety of things that are far outside the scope of this forum." If it is so far beyond us, I guessed you were trying to get a man on the moon.
                                                  It's not beyond anyone here, it's just not related to RH7 and as such is so terribly off topic that it's beyond the scope of this forum, not the people in it.
                                                  quote:

                                                  It also sounded like a way of saying you didn't want to hear any more on the subject.
                                                  Only because what Javascript and ActiveX controls can theoretically do isn't really an RH7-related topic. It's a pointless debate because computer security is more of a philisophical point rather than a useful Q&A for this forum. Either RH7 has a trick up its sleeve or it doesn't. It doesn't, so the question is answered and the topic ceases to be useful for addressing the initial post. Thus, pretty much closed. As far as I'm concerned the only reason this topic still gets posts is for you and me to clarify our thoughts. ;)
                                                  quote:

                                                  Maybe you are looking at the Adobe logo against my name and thinking I work for them.
                                                  No, not at all. I assume no Adobe employee reads here for I don't recall ever seeing an official response. Oddly, there is official response on the Yahoo group HATT, but that forum is not RH-specific, which makes it all the more ironic that the RH's group manager would reply there but not here.
                                                  • 22. Re: Batch file execution
                                                    Peter Grainge Adobe Community Professional (Moderator)
                                                    Just because RH7 cannot do something does not mean the answers cannot be found on these forums. Often the answers are very much about how to do what RH does not do.

                                                    Over and out.