In windows, to start the shell in bat, because cygwin is required to execute the daily scheduled task, a scheduled task is installed in cygwin to complete the task. However, in windows, it may be troublesome. Considering that windows has a scheduled task, if you can schedule the task, start the application or bat script on time every day. Because the script is a shell script, it cannot be executed directly in windows. It can only be executed through cygwin. Therefore, you must start cygwin in bat and write the bat file: 1 @ echo off2rem change to d: 3d: 4rem change the dir5chdir D: \ cygwin \ bin6echo "begin... "7rem start the cygwin and run the shell file.8D: \ cygwin \ bin \ mintty.exe/home/scripts/webFunc a problem occurs: After cygwin is started, the command cannot be run, which has been plagued for several days. I still don't know why the shortcut can be run directly, but the "ls, find, mkdir" and other commands cannot be found after bat is started .. At first, I thought it was bat that I needed to pass some parameters to cygwin. I checked its shortcuts and found no special parameters. It was not until now that we realized that it was an environment variable problem, so we added cygwin \ bin after the path of the environment variable. The problem was solved. In a small part, find is used in my shell script, while find is also available in windows. Therefore, the system uses the find command in windows by default, so an "parameter error" exception is always reported. After changing find in shell to/user/bin/find, the problem is solved. Fortunately, there are not many scripts, so there are two or three places to use find. After the change, it is executed normally. In addition, mysql is used in the script. Therefore, you need to install mysql and add environment variables. Porting from linux to windows sounds very simple. There are still many problems encountered during the process. Another problem is the path problem in the code. When I first wrote the code, I wrote all the search and configuration paths to the dead. When I transplanted them, I only needed to manually change them to windows to recognize them. Pay more attention in the future, and try to conform to posix standards.