shortcut to execute command in cygwin bash

I have a command
unison myprofile -batch
which works fine in cygwin bash shell. It uses ssh, unison and probably rsync to work.
How can I make a windows shortcut that can execute this command?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Assume that your cygwin is installed at c:\cygwin\

1. In cygwin , create and shell script called with the following content
---- /home/<your login name>/  ----
/full-path-to-unison myprofile -batch

2. Open the notepad, create a batch file on desktop with this content
---- backup.bat -----
c:\cygwin\bin\sh.exe  /home/<your login name>/

3. The double click on backup.bat. Or you can create a shortcut for backup.bat.
NewtonianBAuthor Commented:
Thanks wesly I have a problem though something is screwy seems to be happening with unison when ran from this bat script. Some paths are different.

All that syncprofile has is
root = /cygdrive/c/myfolder/
root = ssh://user@server//cygdrive/c/myfolder/

Through the bat script instead of getting

unison syncprofile -batch
Contacting server..
Connected //MYSERVER//cygdrive/c/myfolder -> //LOCAL//cygdrive/c/myfolder
Looking for changes
      Waiting for changes
      Reconciling changes
I get      

C:\Users\NEWTON\Desktop>c:\cygwin\bin\sh.exe  /home/NEWTON/
Contacting server...
Looking for changes
Warning: No archive files were found for these roots, whose canonical names are:

This can happen either
because this is the first time you have synchronized these roots,
or because you have upgraded Unison to a new version with a different
archive format.

Update detection may take a while on this run if the replicas are

Unison will assume that the 'last synchronized state' of both replicas
was completely empty.  This means that any files that are different
will be reported as conflicts, and any files that exist only on one
replica will be judged as new and propagated to the other replica.
If the two replicas are identical, then no changes will be reported.

If you see this message repeatedly, it may be because one of your machines
is getting its address from DHCP, which is causing its host name to change
between synchronizations.  See the documentation for the UNISONLOCALHOSTNAME
environment variable for advice on how to correct this.

Donations to the Unison project are gratefully accepted:

Reconciling changes
Nothing to do: replicas have not changed since last sync.

Press any key to continue . . .
where is your myprofile -batch file in cygwin?

---- /home/<your login name>/  ----
#!/bin/sh -x
/full-path-to-unison  /full-path-to-myprofile -batch
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

NewtonianBAuthor Commented:
It's in
The path within cygwin, not Windows
Is it  /home/NEWTON/.unsion/myprofile ?
The modify the with the full path to myprofile
NewtonianBAuthor Commented:
yes that's the path, I tried that unfortunately same problem umm
1.  Within cygwin
$ cp  /home/NEWTON/.unsion/myprofile  /cygdrive/c/Users/NEWTON/Desktop/syncprofile

---- /home/<your login name>/  ----
#!/bin/sh -x     # <== debug mode
/full-path-to-unison /cygdrive/c/Users/NEWTON/Desktop/syncprofile  -batch

---- backup.bat -----
set HOME=\Users\NEWTON
c:\cygwin\bin\bash  -c '/home/NEWTON/'

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.