I use a windows Server 2003 machine to run R code in batch mode every night using the following command: "F:\Program Files\R\R-2.4.1pat\bin\R.exe" CMD BATCH --vanilla --slave "batch_master_dr.R" This produces an output file, of which the first three lines look like this: Loading required package: tcltk Loading Tcl/Tk interface ... done Loading required package: R2HTML 99% of the time this works great. Every once in a while, I get the following error message instead and it does not run any of my subsequent code: Loading required package: tcltk Loading Tcl/Tk interface ... Unable to register TkTopLevel class This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Does anyone have any clue where I should look to fix this problem? Thanks, Roger version.string R version 2.4.1 Patched (2007-02-04 r40647) ********************************************************************** * This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No right to confidential or privileged treatment of this message is waived or lost by any error in transmission. If you have received this message in error, please immediately notify the sender by e-mail, delete the message and all copies from your system and destroy any hard copies. You must not, directly or indirectly, use, disclose, distribute, print or copy any part of this message if you are not the intended recipient.