Berkeley Posted March 31, 2011 Share Posted March 31, 2011 (edited) I am trying to use _RunDos and I have tested my command string as a batch file and it runs fins but _RunDos seems to do nothing. I have looked at the documentation and searched the forums but as far as I can tell this should work. The $cmd string would be: "C:\Program Files\PDF2TIFF\mogrify" -format TIF -density 300x300 "C:\Documents and Settings\bjd2483\My Documents\BIN\001.pdf" $cmd = '"C:\Program Files\PDF2TIFF\mogrify" -format ' & $NewExt & ' -density 300x300 -compress Group4 -type bilevel -monochrome ' & ' "' & $FileLoc & '\' & $file & '"' FileClose($search) _RunDos($cmd) Thanks, Berkeley Edited March 31, 2011 by Berkeley Link to comment Share on other sites More sharing options...
hannes08 Posted March 31, 2011 Share Posted March 31, 2011 Hi Berkeley, I can't see any error in your code. The only thing I would change is: -monochrome ' & ' "' & $FileLoc & '\' & $file & '"' to -monochrome "' & $FileLoc & '\' & $file & '"' Maybe you want to put a MsgBox Or a ConsoleWrite before the _RunDOS, then you might e able to see an error in your Variables. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
Berkeley Posted March 31, 2011 Author Share Posted March 31, 2011 Before I posted I actually used FileWrite to make a batch file and then run it and the batch file ran fine. Your clean up is a good idea and I changed that. $cmd = '"C:\Program Files\PDF2TIFF\mogrify" -format ' & $NewExt & ' -density 300x300 -compress Group4 -type bilevel -monochrome "' & $FileLoc & '\' & $file & '"' ;MsgBox(0, "", $cmd) ;$bat = FileOpen(@ScriptDir & "\test.bat",1) ;FileWrite($bat,$cmd) FileClose($search) _RunDos($cmd) ProcessWaitClose("mogrify.exe") Link to comment Share on other sites More sharing options...
Berkeley Posted April 1, 2011 Author Share Posted April 1, 2011 figured it out. can' figure out why but it wanted quotes around the entire command line $cmd = '"C:\Program Files\PDF2TIFF\mogrify" -format ' & $NewExt & ' -density 300x300 -compress Group4 -type bilevel -monochrome "' & $FileLoc & '\' & $file & '"' $qcmd = '"' & $cmd & '"' _RunDOS($qcmd) 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