Auto-py-to-exe automatically runs cscript.exe

156 views Asked by At

I am using VBScript in my code to convert each sheet of a given excel file into a CSV file. I have tried other methods such as using pandas but they are comparatively slow and the vb script method performs pretty well when I run the script.

The only problem I am facing is that when I use auto-py-to-exe to convert my script into an exe for a client, the VBScript is executed automatically when auto-py-to-exe is compiling the code.

I have searched a lot but couldn't find anything similar to my problem. Any help in this regard would be much appreciated. Thanks!

The snippet where I call cscript is given below:

    if not os.path.exists('./Temp'):
        os.mkdir('./Temp')
    s = time.time()
    temp = './Temp'
    call(['cscript.exe', os.path.join(os.getcwd(),'ExcelToCsv.vbs'), filename, temp])
    e = time.time()
    print("Time taken to convert excel sheets to CSV files: ", e - s)
1

There are 1 answers

2
MrSquidward On

Well, maybe this will sound stupid, but have you tried replacing call function within os.system function? I have done something like that many times and it worked perfectly. This is the first time i see this error.