Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm currently trying to setup a task that will email me when the deployment has finished. It seems fairly simple, and I've looked online as a reference. I found one person (Johan I believe) that had a custom ZTISendMail.wsf file that you can install as an application, but even that seems like it's above and beyond what I need. I could be wrong, if so please correct me. What I have is a short .vbs script that when run sends me an SMTP mail. It works from my computer just fine, as well as the deployment server (when double clicked). I've tried placing it on the root of the deployment server, then adding a command line task sequence as the very last step. I've tried with just the c:\notify.vbs command line in there as well as cscript.exe c:\notify.vbs, both give me the same results at the end (failure). I have tried setting "Start in" as C:\ as well to no avail. Am I missing something? This seems like it would be fairly simple to just run the vbs script which would shoot a message off to me. Why is it having a problem running it? Thanks.

share|improve this question
add comment

2 Answers

Try placing the script into the Scripts folder on your MDT server and firing the script with "cscript Z:\YourScript.vbs" as a step.

EDIT:

It should just be "cscript Z:\Scrupts\YourScript.vbs". The steps in MDT execute in the context of the administrator of the box being built. That account has Z: mapped to the DeploymentShare directory during the build. You shouldn't need to worry about where the script starts unless you have an external dependency.

share|improve this answer
    
So when I put the script in the scripts folder, do I need to specify "cscript c:\deploymentshare\scripts\notify.vbs" in the command or would I set it like this: Command line says "cscript notify.vbs" and Start In says "c:\deploymentshare\scripts" ? –  Don Feb 3 '12 at 21:00
    
Ahh, I didn't realize that about the Z drive, good to know, thanks! I'll give it a shot and get back with the results. Thanks for the quick responses! –  Don Feb 3 '12 at 22:48
    
Technically I think you are supposed to use an environment variable for this kind of access.. I always end up using a hard coded path though. The official MDT documentation explains of pretty well. –  Tim Brigham Feb 3 '12 at 23:09
    
Well, it all looks good but at the end of the task sequence, it still fails on the Notify line. I set it up just like you suggested above, I'm not sure what else could be stopping it. The vbs script will run fine outside of MDT, but when i have it set to run as a task it doesn't run. –  Don Feb 7 '12 at 19:20
add comment

Try this:

cscript.exe "%SCRIPTROOT%\notify.vbs" /debug:true /debugcapture

The %scriptroot% will ensure it defaults to the scripts folder and the /debug:true /debugcapture wil help capture additional information to troubleshoot.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.