Jump to content

Recommended Posts

Posted

I have an 1.exe that runs from @temp and uses another 2.exe that must be in the same dir (@temp). But I can't get 1.exe to run with path of @temp and process files in $somefolder. I have tried changing working dir in run(), and filechangedir().

I can get it to work if I use cmd.exe and run script from $somefolder. like this:

Run("C:\WINDOWS\system32\cmd.exe")
    WinWaitActive("C:\WINDOWS\system32\cmd.exe")
    send('set path=' & @TempDir & "{ENTER}")
    Send('for %a in ("*.*") do 1.exe -s  ' & $option & '  "%a"' & "{ENTER}")

But I need to make it work from anywhere, when $somefolder is set with FileSelectFolder. Like This:

$somefolder = FileSelectFolder("Select Folder", "")
$Afiles = _FileListToArray($somefolder)
$1exe = @TempDir&"\1.exe"

for $i = 1 to $Afiles[0]
    $file = $Afiles[$i]
    Run('"' & $1exe & '" -s ' & $option & " " & $file, $somefolder)
Posted

I am happy to elaborate as needed. I am sorry if I sounded cryptic, not my intentions. I just dont know what information is useful. 1exe is an exe that when given the intended file size (-s & $option) and input file ($file) will run ffmpeg (located in same folder as 1exe) and calculate the bitrate required for ffmpeg to output the file at intended file size. I can run 1exe with ffmpeg in $somefolder. But not from @Temp and still process files in $somefolder.

Is this enough info? Please ask if you need more.

Posted

The failure is that when i run 1exe from @temp it looks for ffmpeg in the working dir. And passes working dir to ffmpeg. So if ffmpeg is in $somefolder, then everything works. In the first post you see that with cmd you can change path and working dir stays @scriptdir. A workaround for my problem is to copy ffmpeg to $somefolder, bit i was hoping for a solution. Is there one? Thanks for helping.

Posted

no uac issues. can run process with files in ffmpeg folder (@temp). For now I will use the workaround, and copy ffmpeg to $somefolder, then delete after. Just hoping there is better way. thanks again for the help

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...