Kaseya Community

"Write File" Step Keeps Failing

  • As long as I have been writing scripts, I've been using CMDOW (http://www.commandline.co.uk/cmdow/) to hide my batch files in my scripts. Sometime over the last week, the step that writes the file to system32 has started failing. I've edited the script to try to drop the file right on the %systemdrive%, and I've replaced the file thinking that it may have been corrupted, but no matter what, the step fails. Does anyone use CMDOW and/or has had this problem? Has anyone had this problem with any other files?

    The only thing I can think of is KES on the KServer sees it as a virus (even though it's not) and maybe it's removing it or quarantining so it can't bepulled from the KServer. It still shows up as being an available file to write, so I'm guessing it's a quarantine issue, or KES is deleting it and the KServer sees it as a missing file and puts it back. Either way it's driving me crazy.

    Any ideas?

    Legacy Forum Name: "Write File" Step Keeps Failing,
    Legacy Posted By Username: mclark
  • have you tried replacing that file with one you know works, such as a blank text file? Just to make sure that the problem is with the file and not the write file script option...

    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: byulke
  • Yep! I've changed the step to write batch files and other EXEs, but CMDOW seems to be the only one having this problem. We tried to exclude the VSASharedFiles directory from KES scans, but it's still not working. For now, I've disabled the step since the file is already on all of the machines that I run this script on (I just keep it there for good measure, and to copy the file to machines that are using CMDOW for the first time).

    I'm leaning more and more towards KES being the issue, because the time that the step started failing seems to coincide almost perfectly with the KES install.

    Thanks for the reply!

    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: mclark
  • Well, my initial thoughts were correct. KES was seeing it as a virus, and it just took several days for the KES exclusion to allow the step to succeed. Seeing as how we arebeginning to push KES to a lot of customers, I started researching alternatives to CMDOW and found RunHiddenConsole. It just happened to be on my favorite unattended install forum (msfn.org) and is available for download here:


    (Registration required, but it's a good board to be registered to)

    It works a lot better than CMDOW because for CMDOW to work, you had to put it as a step in your batch file.This means that if you put it at the beginning of your batch, the command prompt would pop up briefly and then disappear. The way RunHiddenConsole works is you call your batch file from it, so there is no notification that there is a batch being run, except for the process in Task Manager.

    It's only 1.5KB and it's not seen as a virus. It also helps with hiding wget transfers.

    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: mclark