• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JScript: file exists and mailto???

 
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey there, I'm writing a batch file for a bunch of stuff and I'd like to insert a JScript file to check if a file exists and then if it doesn't, I'd like to sent an email alerting me of that fact. Here's what I can get so far:

However, I'm not sure what to write after that--checking the boolean and then mailing me an alert. If it's not possible to mail myself an alert email, I might just try to create a new file on the Desktop or something that I'll see, so I'd appreciate it if you could show me how to do that as well (just creating a blank file).
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are talking about JScript as in Sever Side Microsoft JScript (ASP)? or as an abrev. to JavaScript?
If you are talking about server side, then you are going to need to find code for a mailer. Do a search on googe and I am sure you will find an ASP/JScript type of mailer out there.
I am not sure what you are exactly looking for here as an answer.
 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is true that I'm running my batch file on a server, but really I don't think it's server-side code that we're talking about, b/c I'm just running myFile.bat to perform a whole bunch of file operations, and in the middle of them I want to call a myScript.js to make sure that a file exists, and if it doesn't then I'd like to alert myself somehow (preferably with something that mails me an email message the way that mailto does in Unix). It seems like what I'm doing would be the same no matter what--server or client machine--because I'm running it for local stuff.
And yes, I meant JScript as in Microsoft's stuff. Apparently, I can call a anything.js file from a batch file since it's supported by Microsoft as one of 2 or 3 scripting languages that can be called for Windows purposes.
Honestly, I'm just a Java guy who's trying to figure out how to script this stuff in here, and JScript looked like a likely option, but I'm not finding it so easy to figure out...
reply
    Bookmark Topic Watch Topic
  • New Topic