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

Author Topic: Help needed for batch file  (Read 4728 times)

0 Members and 1 Guest are viewing this topic.

unclemeat

    Topic Starter


    Starter

    • Experience: Familiar
    • OS: Windows 10
    Help needed for batch file
    « on: July 11, 2017, 05:21:41 AM »
    made batch file as below which is so far ok.

    echo off
    title My Batch File
    :: See the title at the top. And this comment will not appear in the command prompt.
    echo Test file executed.
    START C:\OtsLabs\otsstud.exe "c:\galah\harry jakamarra.ots"
    pause

    this opens the file i want fine however i want to export the file o however it was imported.
    this is done via file/export/as native file(s) which takes you to another screen with a few variables to confirm.
    any clues on how i can do this ?

    thanks if so
    rob
    « Last Edit: July 11, 2017, 05:37:30 AM by unclemeat »

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Help needed for batch file
    « Reply #1 on: July 11, 2017, 03:01:28 PM »
    a keyboard/mouse macro could do this. Call to macro from batch and it does whatever needs to be done. This is how I would do this. I use a product called jitbit macro recorder that allows me to go though the process and record what needs to happen, then i can compile it to an exe and call to the exe macro to do it unattended.

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Help needed for batch file
    « Reply #2 on: July 11, 2017, 03:22:11 PM »
    Yes, taht is a good idea. A mcro recoder can do things taht are otehrwise tough in puter batch.
    The are a number of 'hot key' and 'macro rec oders' out there. Some free, others are worht the money. Your choice.
    Here is a genral reference:
    10 AutoHotkey Alternatives To Create Your Own Macros and Apps
    Of the ten, three are notworthy, IMO.
    WinAutomation
    JitBit Macro Recorder
    AutoKey
    Wutg regard ti the later, there is a product with a similar name:
    AutoHotkey
    https://www.computerhope.com/jargon/a/autohotkey.htm

    So, now the issue is how to decide which is right for you.  :)

    For those who wish to dig deeper, start with this:
    https://en.wikipedia.org/wiki/AutoKey
    Quote
    AutoKey is a text expansion/replacement utility for Linux and X11.[1] It is heavily inspired by the commercial Windows software 'PhraseExpress
    ..and there is more, but I will stop here.  :)

    unclemeat

      Topic Starter


      Starter

      • Experience: Familiar
      • OS: Windows 10
      Re: Help needed for batch file
      « Reply #3 on: July 11, 2017, 03:59:20 PM »
      Thanks - if I was to do this for a lot of files as a batch file do I put the saved macro underneath the
      Start line ?

      unclemeat

        Topic Starter


        Starter

        • Experience: Familiar
        • OS: Windows 10
        Re: Help needed for batch file
        « Reply #4 on: July 11, 2017, 04:01:41 PM »
        Or would be possible to save a macro recorder as an .exe file with a variable so that it goes through a number of the same files (different names) or all files in a folder ?

        Geek-9pm


          Mastermind
        • Geek After Dark
        • Thanked: 1026
          • Gekk9pm bnlog
        • Certifications: List
        • Computer: Specs
        • Experience: Expert
        • OS: Windows 10
        Re: Help needed for batch file
        « Reply #5 on: July 11, 2017, 04:29:28 PM »
        unclemeatm,
         downlod a free version of any of the macroprograms and answer your own question.

        DaveLembke



          Sage
        • Thanked: 662
        • Certifications: List
        • Computer: Specs
        • Experience: Expert
        • OS: Windows 10
        Re: Help needed for batch file
        « Reply #6 on: July 11, 2017, 06:21:07 PM »
        START C:\OtsLabs\otsstud.exe "c:\galah\harry jakamarra.ots"
        (( add a timer here to allow for program to launch to a known state ))
        Call Macro Here

        such as you can use ping as a delay to ping 127.0.0.1  20 times and then move on to launching your macro, which i have named as runmacro1.exe. You can use sleep and other time delays as well. Ping is a quick one that supports most systems.

        Code: [Select]
        START C:\OtsLabs\otsstud.exe "c:\galah\harry jakamarra.ots"
        ping 127.0.0.1 -n 20
        runmacro1.exe

        jacky88



          Newbie

          • Computer: Specs
          • Experience: Beginner
          • OS: Windows 7
          Re: Help needed for batch file
          « Reply #7 on: July 19, 2017, 08:36:46 AM »
          Hi all, needed help: How to make commands with wildcard combination to delete a folder

          I always use a batch file to easily remove unnecessary files in %TEMP% that I put on my Startup in Startmenu.
          But I had trouble using a combination wildcard asterisk(*) to delete a folder with its name contains a dot(.) mark.
          Here's details, if I open Photoshop CS6, there always made 8-9 useless files (files + folders) in profile Temp. There is no problem to remove all by using batch file, but there is one obstacle for me to remove using asterisk to a folder as the name lilo.3248.

          Actually, it's so easy to remove if I use full name, example:
          Code: [Select]
          @echo off
          if exist %TEMP%\lilo.3248 rd /s /q %TEMP%\lilo.3248 => works without problem

          But it's a problem if I try using wildcard(*), like this:
          Code: [Select]
          @echo off
          if exist %TEMP%\lilo.* rd /s /q %TEMP%\lilo.* => failed
          if exist %TEMP%\li*.* rd /s /q %TEMP%\li*.* => Same failed

          Why I use wildcards.. because the figures after the dot could always be changed to a new numbers each time when I open new Photoshop, sometimes 3digits, sometimes 4digits erratically. The numbers were created randomly as lilo.743, lilo.2935 etc.. Therefore I use wildcards to be easier, but failed.
          In general, for directory name without dot + wildcard, I usually can remove them easily. But, this method not work to this case.. confused.

          So, does anyone know how to make the commands work according to my needs like above? Thanks in advance.
          « Last Edit: July 19, 2017, 08:59:24 AM by jacky88 »