Starcom Posted July 3, 2007 Share Posted July 3, 2007 (edited) Hello, I need to compress a file with a name including space "test file.bin". In my script directory, I have put the gzip directory. I've tested using the "Run" command and it works fine if I remove the space in the file name but not if I let it. Then I testes using the "ShellExecute " command... My FileMove doesn't seem to work either. $FileName = @ScriptDir $FileName = FileSaveDialog("Select a file", $FileName, "(*.bin)", 2) $i_FileSize = FileGetSize($FileName) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $i_FileSize = ' & $i_FileSize & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console Compress($FileName) $i_FileSize = FileGetSize($FileName) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $i_FileSize = ' & $i_FileSize & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console Exit Func Compress($FileName) Local $s_WorkFile = @ScriptDir & "\Work.tmp", $s_File = $FileName FileCopy($s_File, $s_WorkFile, 9) ; $com = ".\gzip\gzip -f4 " & Chr(34) & $s_WorkFile & Chr(34) ; Run($com, "", @SW_HIDE) ShellExecute(".\gzip\gzip.exe", "-f4 " & Chr(34) & $s_WorkFile & Chr(34), "", "", @SW_HIDE) $s_WorkFile = $s_WorkFile & ".gz" ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $s_WorkFile = ' & $s_WorkFile & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $s_File = ' & $s_File & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console FileMove($s_WorkFile, $s_File, 1) EndFunc Edit: I find the solution myself using the command ShellExecuteWait instead of ShellExecute. Edited July 3, 2007 by Starcom Link to comment Share on other sites More sharing options...
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