help with .bat command

Status
Not open for further replies.

benny237

Solid State Member
Messages
20
OK, so I am one step away from completing a .bat file. . .

when a user clicks on a link, a .bat file is ran . . . this file extrapolates the name of the user's computer and creates an email message automatically addressed to our company's IT department along with the name of the computer. . .

does anyone know the command to automatically send the message? as it is now, everything is populated correctly, however the user still has to click "send". . .

PLEASE help me out, I have been searching the net for days now with now luck . . .

again in summation, what is the command prompt command to send the email?

- code of script -

@ECHO OFF
START mailto:helpdesk1@oncologyallies.com?subject=%computername%^&body=%computername%



also, does anyone know a way I could include the ip address in the body of the email? right now our techs can see the computer name in the subject. . . but it would be nice if the ip was included in case the DNS is messed up. . . something like %ip% ???

this is for windows xp btw. . .

thanks everyone for your help!! this has been realllllllllllly tough . . . :D
 
I am afraid that is as far as you can get with a batch file. You are sending a command line parameter to their default mail program. Outlook, Thunderbird, etc.. all operate differently there is no way a batch file can tell all those programs to push the send button. You can however use a batch command to create the isp information into a text file but again the user would have to attach it themselves.

ipconfig /all > fileatt.txt
 
hmmm . . .thanks for your response. . .

so perhaps I should use a different way to extrapolate the info and then automatically send?

any suggestions as to how I would do this. . .

this is for our company's intranet site, when user's call in the first question is always "what is the name of your system?" - usually the computer is labeled incorrectly and therefore our techs have to step them through how to find the name, by right clicking on my computer, going to properties, etc . . .

so ideally there would be a button on the front page of the intranet that a tech can tell the user to press and then a program executes sending the name of the computer, who's logged on, and ip address to the helpdesk email inbox. . .

this is just a simple html site, with numerous pages connecting together . . . again if anyone has any suggestions as to how this would be accomplished I would be very appreciative and rep you up huge !!

thanks all!
 
You might have to do that with PHP - but still I think there will have to be some user input. Also, you could try doing it with an ActiveX script.

At our company, we automate those kinds of things with VBS scripts.
 
Not that all complicated just not possible with a batch command file. Batch files are limited. The reason you can't just spontaneously send e-mail should be obvious, it would be far too easy to spread spam and viruses that way.

In addition to what SparkMonkeyHellion suggested I would give AutoIT a try you can google the download. AutoIT is a automated script that will send keystrokes and anything you need applications. It is even freeware with BASIC-like scripting language designed for automating the Windows GUI and general scripting. If you can make a batch file you can use AutoIT.
 
Status
Not open for further replies.
Back
Top Bottom