Results 1 to 3 of 3

Thread: Running a .bat file in Wine

  1. #1
    Join Date
    Nov 2013
    Beans
    47

    Running a .bat file in Wine

    I have a very big third party .bat file along with the necessary files in one folder.

    Running this .bat file in Windows is working fine
    Running this .bat file in Wine stopped early due to the fact it's not finding the files used in the same folder.
    As I don't like to change the bat file, i'am looking for a manner to force retrieving the current folder.

    I wrote this .bat to reproduce the problem:

    echo OFF

    if exist *.txt goto :FOUND

    if not exist *.txt goto :NOTFOUND

    :FOUND
    dir *.txt
    goto :END

    :NOTFOUND
    @echo I did not found any txt files

    :END
    pause


    When running in Windows, it shows me the txt files.
    When running in Wine it says the txt files are not found.

  2. #2
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Running a .bat file in Wine

    It seems that the if statement cannot identify files via the wild card (*) in the wine version of cmd, and it causes your bat file to fail.

    Code:
    $ wine cmd
    CMD Version 1.4
    
    Z:\media\multimed-2\test\test0>if exist *.txt echo yes it exists
    
    Z:\media\multimed-2\test\test0>if exist hello.txt echo yes it exists
    yes it exists
    
    Z:\media\multimed-2\test\test0>dir *.txt
    fixme:ntdll:server_ioctl_file Unsupported ioctl 24000 (device=2 access=1 func=0 method=0)
    Volume in drive Z has no label.
    Diskvolymens serienummer är 0000-0000
    
    Directory of Z:\media\multimed-2\test\test0
    
    2013-03-09     17:39           141  1-50.txt
    2012-03-31     16:24            12  hello.txt
    2013-02-10     20:03           516  result1.txt
           5 files                   10,415 bytes
           0 directories     24,164,999,168 bytes free
    
    
    Z:\media\multimed-2\test\test0>
    If you are prepared to use some other command and rewrite the bat file, it might help to know that dir can identify files via the wild card (*)
    Last edited by sudodus; August 28th, 2014 at 12:29 PM. Reason: added tip about dir

  3. #3
    Join Date
    Nov 2013
    Beans
    47

    Re: Running a .bat file in Wine

    As the batch file is so long, complex and referencing more than 125 times with different wild card combinations to the files to be treated,
    I prefer not to change it.

    It is unfortunate that it does not work in Wine, so I will run the batch in Windows and copy the result into Ubuntu.

    Anyway thanks for the clear response.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •