Execute a UNIX script from DOS prompt.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Execute a UNIX script from DOS prompt.
# 15  
Old 12-12-2006
Quote:
Originally Posted by Raynon
Hi Ghostdog,

The last line after i keyed in my password is below. So do i assign "You have new mail" or "$" ?

You have new mail.
$
You can try "$"..

Quote:
Can you recommend me a website to download and install perl ?


Using Perl Telnet module

Perl SSH Interface

Python SSH

Python Telnet module

personally, i use
Activestate
but there are other flavors, here . you can have a look.

Quote:
Do all the methods above need installation ? Because once the script is created, i will have to integrate it into excel macro for public usage. So if the rest do not have the relevant protocols installed, they wouldn't be able to use it. It would be best if windows batch files could do the job.
Perl for windows needs to be installed if you do not already have it.
Once the script is created, you can just run it from command line using the Perl interpreter. I don't know how you are going to include your perl script into excel macro, but you can use OLE with Perl to do excel macros. See here
you got to explore on your own from here on, as I seldom do perl+excel macros..so i have not much advice in this area.

for pure batch, the telnet client in Windows does not have capability for auto login.
guess you would have to download 3rd party command line tools like curl, putty etc that you can include in your batch file.

Last edited by ghostdog74; 12-12-2006 at 10:25 PM..
# 16  
Old 12-13-2006
Hi Ghostdog,

I have problems executing the script after installation. My perl script is named as testing.pl.
Error message is in red below.Can you give me some advice?

C:\Perl>perl testing.pl
'perl' is not recognized as an internal or external command,
operable program or batch file.
# 17  
Old 12-13-2006
Quote:
Originally Posted by Raynon
Hi Ghostdog,

I have problems executing the script after installation. My perl script is named as testing.pl.
Error message is in red below.Can you give me some advice?

C:\Perl>perl testing.pl
'perl' is not recognized as an internal or external command,
operable program or batch file.
have you installed Perl correctly, and which version of Perl? the distribution which you have installed should modify the PATH variable for you.
the perl interpreter is usually in the c:\perl\bin directory. So probably you could try
c:\perl\bin\perl test.pl
Also, you can add the perl interpreter path in your windows by modifying the PATH variable. System->Environment variables->Path
# 18  
Old 12-13-2006
HI Ghostdog,

I have downloaded this ActivePerl-5.6.1.638-MSWin32-x86.zip

I tried you method and it does work. However, there's some compliation error.
Can you give me some guidance on this? I am totally new to perl.

C:\Perl\bin>perl testing.pl
Can't locate Net/Telnet.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib
.) at testing.pl line 2.
BEGIN failed--compilation aborted at testing.pl line 2.
# 19  
Old 12-14-2006
Quote:
Originally Posted by Raynon
HI Ghostdog,

I have downloaded this ActivePerl-5.6.1.638-MSWin32-x86.zip

I tried you method and it does work. However, there's some compliation error.
Can you give me some guidance on this? I am totally new to perl.

C:\Perl\bin>perl testing.pl
Can't locate Net/Telnet.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib
.) at testing.pl line 2.
BEGIN failed--compilation aborted at testing.pl line 2.
hi
you can download the Telnet modulehere

After that, unzip the module. Check that there is a .ppd file
then from the command line,
type

ppm install <filename>.ppd ## substitute <filename>

Activestate PPM will install the module for you.
# 20  
Old 12-14-2006
Hi Ghostdog,

I don;t see any telnet modules in the website you recommended me. What's the file name ?
# 21  
Old 12-14-2006
Quote:
Originally Posted by Raynon
Hi Ghostdog,

I don;t see any telnet modules in the website you recommended me. What's the file name ?
it's at no 96. Net-Telnet
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Script to convert dos to UNIX in Solaris

Hi Team, I am trying to implement a script in Solaris, that required to find the list of files inside directories and convert those to dos2unix conversion, Can someone please help here.. Below is the example of scenario.... (1 Reply)
Discussion started by: Logics123
1 Replies

2. Shell Programming and Scripting

Batch script to execute shell script in UNIX server

Hi team, My requirement is to transfer pdf files from windows machine to unix server and then from that unix server we should sftp to another server. I have completed the first part i.e From windows to using to unix server with the help of psftp.exe code: psftp user@host -pw password <... (1 Reply)
Discussion started by: bhupeshchavan
1 Replies

3. Shell Programming and Scripting

Dos batch script to execute unix shell script

Can anyone help me with a dos batch script to execute a shell script residing in an unix server. I am not able to use ssh. Thanks in advance (2 Replies)
Discussion started by: Shri123
2 Replies

4. Shell Programming and Scripting

Use Unix shell script to open Windows command prompt (cmd)

Hello, I work on Windows and I use Putty to access a remote UNIX server. I am trying to build a shell script that will have as main task to open the Windows command prompt (cmd) and run some Windows commands thereafter. The commands are actually file transfer commands that will download a file... (14 Replies)
Discussion started by: rookie2785
14 Replies

5. Homework & Coursework Questions

Unix Shell Script to prompt customer for name etc

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: How do I create a shell script called 'custinfo' to prompt a customer to enter and display back the following:... (4 Replies)
Discussion started by: SQLScript
4 Replies

6. Shell Programming and Scripting

Execute unix shell script to text file using the script

Hi all, I am beginner in UNIX...I want to use unix shell script to create text.file...I know how to use using by command...can anybody tell me for the script? Thanks i changed the threads title from "tex file" to "text file", because "tex" would probably be misunderstood as reference to... (4 Replies)
Discussion started by: mastercar
4 Replies

7. Windows & DOS: Issues & Discussions

Hide svchost.exe (dos prompt) when executing scheduled task

hello everyone. I created a java program that will pop up a dialog, and scheduled it as a task. Everything works fine except when the scheduled java program runs and the dialog pops up, there is another dos prompt (svchost.exe) hanging behind the dialog box and doesn't go anywhere until the java... (0 Replies)
Discussion started by: milhan
0 Replies

8. Shell Programming and Scripting

execute shell file on DOS prompt

I have installed cygwin on my computer having windows 2003 server as operating system. The following command works fine on DOS console: bash launch_update.sh Is there any way, that i could run the above shell file, just by typing its name on DOS prompt, in the same way as batch files are... (1 Reply)
Discussion started by: mmunir
1 Replies

9. UNIX for Dummies Questions & Answers

Can Unix (Solaris) execute a dos .bat script?

I did a search and found lots of questions/comments about how a dos script could execute Unix but not the other way round. If it's possible, I'd like the link to a post/site that would show me the way. Thanks. (4 Replies)
Discussion started by: BCarlson
4 Replies

10. UNIX for Dummies Questions & Answers

?Using Unix commands in Microsoft (Windows') DOS Prompt?

I ran a search for "Unix Dos" in the search field box and checked a few pages' results but did not find what I was looking for. I am trying to find out if there are choices of applications that would enable using Unix commands inside a Windows environment, particularly the DOS Prompt. The only... (2 Replies)
Discussion started by: HLee1981
2 Replies
Login or Register to Ask a Question