ajenkins Posted February 9, 2014 Posted February 9, 2014 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)
JohnOne Posted February 9, 2014 Posted February 9, 2014 (edited) Just curious, what is the goal? Be easier for someone to figure a solution if you're willing to reveal. EDIT: Are you certain you want to pass folders as well as files to your exe? Edited February 9, 2014 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
ajenkins Posted February 9, 2014 Author Posted February 9, 2014 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.
JohnOne Posted February 9, 2014 Posted February 9, 2014 Maybe you ought to filter for only files to be returned, and maybe even files of the correct type. And maybe elaborate on what exactly is failing, error check. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
ajenkins Posted February 9, 2014 Author Posted February 9, 2014 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.
JohnOne Posted February 9, 2014 Posted February 9, 2014 Perhaps you have UAC disabled, in which case, if your exe is in system folder you might require admin. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
ajenkins Posted February 10, 2014 Author Posted February 10, 2014 thanks, i will check it out and get back to you.
ajenkins Posted February 12, 2014 Author Posted February 12, 2014 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
AdmiralAlkex Posted February 12, 2014 Posted February 12, 2014 Why not use the full paths and skip the whole working dir issue? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now