 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Kudos
Joined: 21 Aug 2006 Posts: 19
|
Posted: Sat Jun 07, 2008 3:43 pm Post subject: Problem passing params to convert doc to txt with >> |
|
|
Hi Guys,
Part of my script is converting all MS Doc files found in the script directory to Txt files using Antiword: http://www.informatik.uni-frankfurt.de/~markus/antiword/
The command I am using works perfectly from Windows run promt/command prompt (see the msgbox), but not from my script. The output file after the >> is getting lost and the output is just going to screen instead.
I have removed all spaces from the file path I am running this from for simplicity. But ideally it would work with spaces in the path too.
Can you help please? I have been struggling with this for hours!
Thanks!
Kudos
| Code: | Loop, %a_scriptdir%\*.doc, 0, 1
{
StringTrimRight,FileName,A_LoopFileName,4
MsgBox, C:\antiword\antiword.exe %A_LoopFileFullPath% >> %a_scriptdir%\%FileName%.txt
RunWait, C:\antiword\antiword.exe %A_LoopFileFullPath% >> %a_scriptdir%\%FileName%.txt
} |
|
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1035 Location: switzerland
|
Posted: Sat Jun 07, 2008 4:45 pm Post subject: |
|
|
I've tested this
| Code: | SetWorkingDir, %A_scriptdir%
Loop, %a_scriptdir%\*.doc, 0, 1
{
StringTrimRight,FileName,A_LoopFileName,4
run, %comspec% /c c:\antiword\antiword.exe %A_LoopFileShortPath% >>%FileName%.txt,,hide
}
return
|
if you want see where the problem is , use
run, %comspec% /k yourprogram.exe .... (without hide)
so see the DOS with error comments |
|
| Back to top |
|
 |
Kudos
Joined: 21 Aug 2006 Posts: 19
|
Posted: Sat Jun 07, 2008 5:33 pm Post subject: |
|
|
Thank you garry - perfect
I was wondering what that %comspec% variable was for.. Should have looked it up.
Cheers |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|