Convert .sh file into .exe file

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Convert .sh file into .exe file
# 1  
Old 09-23-2012
Convert .sh file into .exe file

Currently im using putty to execute .sh file.
This file is currently saved onto a server.
The .sh file tries to get files from other server and load the files into the current server.

Now i want this .sh file to run as an .exe file on my desktop.
So that by just double clicking the file and by giving the server's username and password, the file can be executed.

Is this possible to do????
# 2  
Old 09-23-2012
Since you say .exe, I'm assuming you use Windows.

You can create a batch file which uses plink to do so. It's just like putty except non-graphical, designed to be automated.
# 3  
Old 09-26-2012
Hi,
bat file works for any cmd commands.
but in my case i have to connect to servers to get the data.
and i connect to the server using putty.

so if you can tell me how to make bat file that can connect to any server and get data and execute commands.
# 4  
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..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question