/closescript Not Working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • armsys
    Enthusiast
    • Jan 2004
    • 40

    /closescript Not Working

    "C:\Program Files (x86)\Beyond Compare 4\BCompare.exe" @"C:\Script.bc" /closescript
    That's, upon finish of the script, the dialog window remains on the screen.
    Currently, the switch /closescript has no effect.
    Question:
    1. How to run a script silently?
    2. How to run a script without showing any dialog window?
    3. How to close a script upon finish?
    Thank you.
  • Aaron
    Team Scooter
    • Oct 2007
    • 15941

    #2
    Hello,

    Which version of BC4 are you currently using? Is it the latest 4.1.2 32bit or 64bit? You can check in the Help menu -> About dialog. The install location could be either version, depending if you updated.

    /closescript is currently working on my test system (Win7 64bit with 4.1.2 64bit).

    Are there any errors with your current script, as a pop up warning or in the log?

    1. Yes, you can add /silent but I wouldn't recommend this until the script is running perfectly. Silent suppresses everything: the dialog, warnings and even error messages. You will want to review a log if you are running with silent.

    2. You would use silent to suppress any dialogs

    3. silent would never show a dialog, so there's nothing to close. Without silent, /closescript is expected to close the dialog and should work once we figure out what is going on. Also, is the Close when finished checkbox enabled in the script dialog?
    Aaron P Scooter Software

    Comment

    • armsys
      Enthusiast
      • Jan 2004
      • 40

      #3
      Hi AAron,
      Thanks for your quick reply.
      After innumerous tests upon your post, I discover and confirm that the window pop-up issue is caused by XYplorer's Catalog alone.
      On the other hand, when running as an XYplorer script, the result is fine as you described.
      I also test it on Macro Scheduler. It runs fine too.
      Thank you for help.

      Comment

      • R3C0NXD45
        Visitor
        • Mar 2016
        • 4

        #4
        I'm not sure if it will be of any help but I'd try the following for /closescript:
        "C:\Program Files (x86)\Beyond Compare 4\BCompare.exe" /closescript @"C:\Script.bc"

        And the following for /silent:
        "C:\Program Files (x86)\Beyond Compare 4\BCompare.exe" /silent @"C:\Script.bc"

        As Aaron has noted it would probably be best to have the script running flawlessly before using /silent or at least having verbose logging on:
        log verbose append:"C:\Logs.txt"

        Again, not sure it would help as it might make no difference at all but that's the order I use and both /closescript and /silent work great for me.

        Comment

        • tired
          Enthusiast
          • Apr 2005
          • 38

          #5
          I'm having an issue with scripts closing properly. What I see is that sometimes, the progress window (i.e. log) will say that the script is complete, but the button still shows "Cancel" and not "Close". I've had very inconsistent results with /closescript and the "Close when finished" option.

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 15941

            #6
            Hello,

            The cancel button would indicate the script is not completed, but the log message that script is finished should be the marker that it is complete. These two seem to contradict each other. If not actually complete, that would be why /closescript is not taking that step. Would it be possible to get a copy of your log to see what steps were taken and what might be keeping it from completing?

            If you let the script sit for a prolonged period of time (as long as you can test), does the script eventually complete?
            Aaron P Scooter Software

            Comment

            • tired
              Enthusiast
              • Apr 2005
              • 38

              #7
              Thanks for the reply. Below is a copy of the log from me having just run the script. I've edited out my user name but that's it.

              The script window hung for almost 6.5 minutes before "Cancel" turned to "Close". I had been seeing the "Completed in XX seconds" message in the log and thinking that meant the script was done.

              So I guess the question is: Why does it hang for so long?

              Code:
              3/21/2016 2:47:45 PM  >> 3/21/2016 2:47:45 PM  >> #log normal  append:"C:\Users\xxxxxx\Documents\Beyond Compare Scripts\Sync D to E.log"
              3/21/2016 2:47:45 PM  >> log normal         "C:\Users\xxxxxx\Documents\Beyond Compare Scripts\Sync D to E.log"
              3/21/2016 2:47:45 PM  >> #log verbose append:"C:\Users\xxxxxx\Documents\Beyond Compare Scripts\Sync D to E.log"
              3/21/2016 2:47:45 PM  >> #log verbose        "C:\Users\xxxxxx\Documents\Beyond Compare Scripts\Sync D to E.log"
              3/21/2016 2:47:45 PM  >> criteria attrib:rsh version timestamp:0sec size
              3/21/2016 2:47:45 PM  >> load D:\ E:\
              3/21/2016 2:47:45 PM  Load comparison: D:\ <-> E:\
              3/21/2016 2:47:45 PM  >> filter "-.\$Recycle.Bin\;-.\Search\;-.\System Volume Information\;-.\Temp\"
              3/21/2016 2:47:45 PM  >> option confirm:yes-to-all
              3/21/2016 2:47:45 PM  >> sync create-empty mirror:left->right
              3/21/2016 2:48:26 PM  Successfully synchronized 87 items.  Completed in 40.8 seconds.
              3/21/2016 2:54:11 PM  >> 
              3/21/2016 2:54:11 PM  >> # End of script.
              3/21/2016 2:54:11 PM  Script completed in 6 minutes, 26 seconds
              Last edited by tired; 21-Mar-2016, 01:59 PM.

              Comment

              • Aaron
                Team Scooter
                • Oct 2007
                • 15941

                #8
                After BC4 ends the script, we then try to close down (freeing memory, closing connections, etc). Usually this occurs quickly, but the types of drives you've loaded might have an impact. What types of drives or devices are D:\ and E:\? Are they both internal hdds or are either external disks or remote connections?
                Aaron P Scooter Software

                Comment

                • tired
                  Enthusiast
                  • Apr 2005
                  • 38

                  #9
                  They're both internal SATA HDDs:

                  Make = Western Digital
                  Model = WD4001FAEX [D:] and WD4003FAEX [E:]
                  Interface = SATA 6 Gb/s
                  Form factor = 3.5 Inch
                  RPM = 7,200
                  Capacity = 4 TB
                  Cache = 64 MB

                  http://www.wdc.com/en/products/produ...px?id=760#Tab3

                  Comment

                  • Aaron
                    Team Scooter
                    • Oct 2007
                    • 15941

                    #10
                    Do you have any antivirus scanning software or other software running that might interact with the harddrives or BC?

                    Also, have you rebooted since the initial test and the issue persists?
                    Aaron P Scooter Software

                    Comment

                    • tired
                      Enthusiast
                      • Apr 2005
                      • 38

                      #11
                      Yes, I run an AV (Kaspersky). Your previous message actually made me realize I need to see if that's getting in the way, so I've added an exclusion for BCompare.exe. (I think that's the only process I would need to worry about in this context.)

                      I suspect that will make a big difference. I apologize for the red herring in that case.

                      Edit: It looks like the AV was at fault. I should have realized this before posting here. But I'm a new user of Kaspersky, and I am only now realizing how intrusive it is. In any case, adding an exclusion in Kaspersky for BCompare.exe to "Do not scan files before opening" seems to have worked around the issue.
                      Last edited by tired; 23-Mar-2016, 11:52 AM.

                      Comment

                      Working...