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
NWFSCTRL(1)							     nwfsctrl							       NWFSCTRL(1)

NAME
nwfsctrl - Perform server command SYNOPSIS
nwfsctrl [ -h ] [ -S server ] [ -U user name ] [ -P password | -n ] [ -C ] [ -p ncpfs path ] -c | -o | -[f]d nwfsctrl [ -h ] [ -S server ] [ -U user name ] [ -P password | -n ] [ -C ] [ -p ncpfs path ] server command DESCRIPTION
nwfsctrl performs command on server. OPTIONS
-h With -h nwfsctrl prints a little help text. -S server is the name of the server you want to use. -U user user is the user name to use for login. To set the server's time, you need supervisor privileges. -P password password is the password to use for login. If neither -n nor -P are given, and the user has no open connection to the server, nwfstime prompts for a password. -n -n should be given if no password is required for the login. As you need supervisor privileges for setting the date and time, this option is probably not used very often. -C By default, passwords are converted to uppercase before they are sent to the server, because most servers require this. You can turn off this conversion by -C. -o Open bindery. -c Close bindery. -d Down fileserver. This command will complain if there are open files on server. -fd Down fileserver, regardless of opened files. load module options... Load module module with options options... on server. Program will complain if module is already loaded. unload module Unload module module from server. Program will complain if module is not loaded. mount volume Mount volume volume. dismount volume Dismount volume volume. If there are open files on volume, server displays prompt on console. You must go to the server (or telnet/xcon- sole) and hit Y or N to get beyond this point). set variable = value Set server settable variable variable to value value. open bindery Open bindery. close bindery Close bindery. enable login Enable login to file server. disable login Disable login to file server. disable tts Disable TTS. This probably does not work on Netware 4.11. enable tts Enable TTS. This probably does not work on Netware 4.11. BUGS
Other commands are not written yet (volume, clear connection ...) CREDITS
This utility was created by Petr Vandrovec (vandrove@vc.cvut.cz) and is part of ncpfs since 2.2.0.11. nwfsctrl 2/12/1999 NWFSCTRL(1)
All times are GMT -4. The time now is 04:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy