DOS MKDIR and BigFix COPY doesn't work as desired

(imported topic written by Matt.Johnson)

Now I am SURE that the code works, when used propertly. I am still new to writing this kind of code so here is what I am trying to do and what code I am using:

Desired actions:

  1. Run a DELETE for folder C:\APPS\FOLDER (Ensuring if it exists that it doesn’t hang the action on step 2

  2. Make Dir C:\APPS\FOLDER

  3. Copy FILE.VBS from \SERVER\SHARE\ to C:\APPS\FOLDER

  4. RUN C:\APPS\FOLDER\FILE.VBS

  5. WAIT for this to complete

  6. DELETE C:\APPS\FOLDER

The code that is failing to work is:

DELETE C:\APPS\SendMail.vbs

COPY \SERVER\share\SendMail.VBS C:\APPS\SendMail.VBS

WAITHIDDEN DOS C:\APPS\SendMail.vbs

Now it says it completed - but it didn’t create the folder, and on the next pass it fails at the DELETE command.

What am I doing wrong here?

Also is there a good Action generator out there?

Thanks!

(imported comment written by SystemAdmin)

If the folder does not exist that you are copying a file to, then it will fail to copy that file.

You must do something like the following:

if {not exists folder “path\to\folder”}

// code to make the folder

endif

Then do your code. The last line should be “waithidden cmd /c C:\APPS\SendMail.vbs”

(imported comment written by jeremylam)

I noticed that you’re trying to copy from a network share.

The TEM client runs as the system user, so it does not have the same credentials as a logged in user - so it cannot log into a network share.

The network share has to be specifically set up so that it can be accessed without authorization - a “null session share”: see http://support.bigfix.com/bes/misc/null_session_share.html for instructions on how to set one up.