Sponsored Content
Special Forums UNIX and Linux Applications Convert .sh file into .exe file Post 302706267 by Corona688 on Wednesday 26th of September 2012 11:18:28 AM
Old 09-26-2012
PUTTY is graphical. It cannot be automated that way. You could do it on the server side, perhaps -- preparing a special account for putty to log into, complete with ssh keys so putty can login passwordless, whose profile goes direct to the scripts you wish to run, etc. Double-clicking on the right profile would put you straight in.

If you cannot do that and must script it on the client side, that's why the same project which made putty also made the plink utility, which can be automated.

Code:
C:\Documents and Settings\User>plink
PuTTY Link: command-line connection utility
Release 0.61
Usage: plink [options] [user@]host [command]
       ("host" can also be a PuTTY saved session name)
Options:
  -V        print version information and exit
  -pgpfp    print PGP key fingerprints and exit
  -v        show verbose messages
  -load sessname  Load settings from saved session
  -ssh -telnet -rlogin -raw -serial
            force use of a particular protocol
  -P port   connect to specified port
  -l user   connect with specified username
  -batch    disable all interactive prompts
The following options only apply to SSH connections:
  -pw passw login with specified password
  -D[listen-IP:]listen-port
            Dynamic SOCKS-based port forwarding
  -L[listen-IP:]listen-port:host:port
            Forward local port to remote address
  -R[listen-IP:]listen-port:host:port
            Forward remote port to local address
  -X -x     enable / disable X11 forwarding
  -A -a     enable / disable agent forwarding
  -t -T     enable / disable pty allocation
  -1 -2     force use of particular protocol version
  -4 -6     force use of IPv4 or IPv6
  -C        enable compression
  -i key    private key file for authentication
  -noagent  disable use of Pageant
  -agent    enable use of Pageant
  -m file   read remote command(s) from file
  -s        remote command is an SSH subsystem (SSH-2 only)
  -N        don't start a shell/command (SSH-2 only)
  -nc host:port
            open tunnel in place of session (SSH-2 only)
  -sercfg configuration-string (e.g. 19200,8,n,1,X)
            Specify the serial configuration (serial only)

C:\Documents and Settings\Username>type test.txt
echo "Hello World"
hostname

C:\Documents and Settings\User> plink.exe -batch -m test.txt -pw mypassword User@hostname
Hello World
mecgentoo

C:\Documents and Settings\User>


Last edited by Corona688; 09-26-2012 at 12:24 PM..
 

10 More Discussions You Might Find Interesting

1. Programming

about exe file

Hi, I am using dual operating system(windows/linux) in my system.Now the problem is i want to run my .exe(of c languege) before system ask for loading of operating system.Like my system ask for linux or dos.I want to run my .exe before this. Tell me how can i use this. (2 Replies)
Discussion started by: at_renai2001
2 Replies

2. Programming

link with others .exe file

hi all, i need your help, want syntax can i write in my programming file so i can combine one executable file with another executable file when i select my executeable file (based on unix operating system)? :( (1 Reply)
Discussion started by: lala
1 Replies

3. UNIX for Advanced & Expert Users

.exe file

Hello all, how to run windows .exe file in Linux and vice the versa (3 Replies)
Discussion started by: rajashekaran
3 Replies

4. Shell Programming and Scripting

embedded exe file into rtf file

Hi All I want a method in shell script which will embed the exe file into rtf file si that the rtf file can be open in word and so my exe. Actually what is happening in my system at present : The report in my system is a self-extracting Zip file with filetype '.EXE'. Double clicking... (1 Reply)
Discussion started by: rawatds
1 Replies

5. HP-UX

How to run .exe file

Hello, I have an test.exe file under a directory. When i execute the .exe file directory from the prompt, i get following error: $ test.exe <enter> ksh: test.exe: not found How do i solve this error? TIA, Ramesh (1 Reply)
Discussion started by: brap45
1 Replies

6. Shell Programming and Scripting

extract .exe file

guys! any clue how to extract .exe file in linux? Regards, Kiran (3 Replies)
Discussion started by: dddkiran
3 Replies

7. Homework & Coursework Questions

Invoke an exe file!!

Hello, Thank you for reading my Thread. I am very very new to Perl / Shell Scripting here. I m assigned some tasks here. I have an exe file on our server. I have to navigate to the path and invoke the exe file. Can someone please guide me with that. Thanks you, Skaranth (1 Reply)
Discussion started by: skaranth
1 Replies

8. UNIX for Dummies Questions & Answers

how to convert .sh to .exe file

Hi, I have prepared 1 .sh script that is running fine in UNIX box. Now I wanted to run that script from windows box. I am thinking of converting it to .exe so that can run this in windows server and use it. Overview: Script basically checks for some values in logs of process running in unix box... (1 Reply)
Discussion started by: ankush_mehra
1 Replies

9. Shell Programming and Scripting

Want to convert to exe file

Hello Gurus, I have written one shell script will check the database healths. Now I want to convert the ksh script to a executable one so that I can install it as a software like windows to any unix systems. How I will achieve this? Thanks- p (12 Replies)
Discussion started by: pokhraj_d
12 Replies

10. Shell Programming and Scripting

Run .exe file with inputs file

Good morning .., I have a problem to run my object program. Before, I run my program in cygwin and there is no problem. When I tried in linux (ubuntu), the terminal said that space.exe : command not found. this is the code in my shell space.exe gr1 result space.exe: command not found... (2 Replies)
Discussion started by: weslyarfan
2 Replies
CONCH(1)																  CONCH(1)

NAME
tkconch - connect to SSH servers graphically SYNOPSIS
conch [-l user] [-i identity [ -i identity ... ]] [-c cipher] [-m MAC] [-p port] [-n] [-t] [-T] [-V] [-C] [-N] [-s] [arg [...]] conch --help DESCRIPTION
The --help prints out a usage message to standard output. -l, --user <user> Log in using this user name. -e, --escape <escape character> Set escape character; 'none' = disable (default: ~) -i, --identity <identity> Add an identity file for public key authentication (default: ~/.ssh/identity) -c, --cipher <cipher> Cipher algorithm to use. -m, --macs <mac> Specify MAC algorithms for protocol version 2. -p, --port <port> Port to connect to. -L, --localforward <listen-port:host:port> Forward local port to remote address. -R, --remoteforward <listen-port:host:port> Forward remote port to local address. -t, --tty Allocate a tty even if command is given. -n, --notty Do not allocate a tty. -V, --version Display version number only. -C, --compress Enable compression. -a, --ansilog Print the received data to stdout. -N, --noshell Do not execute a shell or command. -s, --subsystem Invoke command (mandatory) as SSH2 subsystem. --log Print the receieved data to stderr. DESCRIPTION
Open an SSH connection to specified server, and either run the command given there or open a remote interactive shell. AUTHOR
Written by Moshe Zadka, based on conch's help messages REPORTING BUGS
To report a bug, visit http://twistedmatrix.com/bugs/ COPYRIGHT
Copyright (C) 2002-2008 Twisted Matrix Laboratories. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
ssh(1) October 2002 CONCH(1)
All times are GMT -4. The time now is 04:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy