Forum Discussion
Very helpful!
Thank you
Where can i learn how to build my own scripts?
Great question. Technician Console scripts can be written in and deployed using any language the operating system can execute. For example a script can be written in a batch file using Visual Basic, or it can be a software package.
Some of the examples I provided are probably about as simple as you can get. All I did is use the command you would use at the C prompt and paste it into Notepad and saved it with a ".cmd" extension.
Perhaps a good place to start is using basic commands. Try Googling "command prompt cheat sheet" and that should get you started.
Does anyone have any resources for scripting which they have found useful?
- Sven17 years agoVisitor
I use this to see if the clients ISP is blocking port 25 (smtp traffic). You will have to change SMTPSERVER.COM to a server you know accepts SMTP traffic. You will also need to remove the space after the @ symbol and try to use a known account. Either way it probably won't finish, but as long as you receive something other than this "Connecting To SMTPSERVER.COM...Could not open connection to the host, on port 25: Connect failed" back it is probably open.
@echo off
rem ---------------------------
rem - Port 25 Test -
rem ---------------------------
echo Testing Port 25:
telnet SMTPSERVER.COM 25
EHLO SMTPSERVER.COM
MAIL FROM: TEST@ SMTPSERVER.COMRCPT TO: TESTER@ SMTPSERVER.COM
DATA
Subject: TestThis is a test message you will not see a response from this command.
.
QUIT
echo --------------------------------------------exit
- Omnicron16 years agoNew Contributor
How do you get this to work? I've been trying for along time to get windows' built-in telnet to do this. Telnet takes all input from interactive input (except for user/pwd for telnet links). Trying to run batch files like this halt once the telnet program runs. Trying to redirect input via "<" doesn't go either, nor does using "|".
i.e.
echo telnetdata | telnet ip port
I've heard people point to expect (http://expect.nist.gov) as the solution to doing batc mode telnet control. Typically in my experience you could reduce your batch file to just the telnet line to determine if the port is open or not. Although this
- Omnicron16 years agoNew Contributor
would not account for a filtering proxy or some such other stand in device. All you'll know is if the port is open or not, and not wether you can actually pass email traffic through it.
- chazandchaz13 years agoNew Contributor
You cannot pass text into a telnet session from a batch/cmd file
The only command necessary for your test:
telnet SMTPSERVER.COM 25
You will never be able to actually send a test email using this script.
- TheoP16 years agoVisitor
Hey Rob,
I've included below some links to some of the best sites I've come across for scripting purposes.
www.ss64.com - if you're looking for the syntax you need to get your script going. (has some examples)
www.robvanderwoude.com - probably one of the best scripting sites with examples.
Also, we usually have a folder on most PCs we support with various Sysinternal tools, so when we need to run scripts we can also use those. There are online version of the tools now but we haven't really adjusted our scripts to use those versions.
With your and the rest of the community's help I hope we can make a really good collection of scripts available.
- Bob516 years agoVisitor
To debug VBS scripts interactively, like Visual Basic code debugging, I looked for and found SplineTech VBS Debugger. http://www.remotedebugger.com/ also appears to have a Java and ASP remote versions. ~ $80 for a personal version. Saved me tons of time.
Bob5
- Firasco16 years agoNew MemberThanks. I will check it out.
- TonyS16 years agoVisitor
Hi, I'm wondering if anyone has some examples of scripts for the Mac? Can we run commands in the Terminal? Applescript?
I want to script a reinstall of Java 1.5 which is removed during a Snow Leopard upgrade.
I want to know if it's possible to run these commands as a script
Step 1 Download a file eg
www.cesoft.com.au/downloads/java/java5.zip
Step 2 Run these commands in Terminal
cd Downloads
sudo mv 1.5.0 /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0-leopard
cd /System/Library/Frameworks/JavaVM.framework/Versions/
sudo rm 1.5.0
sudo ln -s 1.5.0-leopard 1.5.0
sudo chown -R root:wheel ./1.5.0-leopardThey should be run in a terminal window, but there may be a way to do it with AppleScript. I hope you can give me some pointers. The user will need to enter a password for the first sudo command