Hello all,
This is my first post, so I hope i supply all the required information.
I am running the latest version of Wing FTP server. I would like to launch a batch called user.bat whenever a user logs into the ftp. I set it to execute the batch when the event happens.
However this does not work for some reason. I log in from an external computer and it does not launch the batch. I even compiled the script into a proper executable (.exe) and this had no effect.
I assume I must be doing something wrong, I would greatly appreciate any helpful advice. Thanks in advance
FTP event, not starting program...
-
- Site Admin
- Posts: 2083
- Joined: Tue Sep 29, 2009 6:09 am
Re: FTP event, not starting program...
First, I want to know which version are you using? if you are using trial version, so no problem.
And why did you encounter this problem? I think it was caused by WingFTP's running mode, Wing FTP Server is running with a Windows Service by default. When you trigger a event, your program will be executed, but maybe without any console window or prompt. So you felt nohing happened, that's an illusion.
If you want to see the console window, I advise you to run or install Wing FTP Server as a normal application. It will help you solve this problem.
And why did you encounter this problem? I think it was caused by WingFTP's running mode, Wing FTP Server is running with a Windows Service by default. When you trigger a event, your program will be executed, but maybe without any console window or prompt. So you felt nohing happened, that's an illusion.
If you want to see the console window, I advise you to run or install Wing FTP Server as a normal application. It will help you solve this problem.
-
- Posts: 3
- Joined: Fri Mar 19, 2010 10:20 pm
Re: FTP event, not starting program...
Hello and thanks for the quick reply.
I am using WFTP version 3.3.5. The program i set to run just places a note on the desktop that tells me when someone logged in, so i dont have to dig thru the logs to find out. The reason im sure the program is not being executed is because no note is left on the desktop after a user is logged in. If i run the program by hand, it works perfectly. Here is the entire batch i wanted to run in the event that someone logs in:
@Echo off
TITLE FTP USER NOTIFICATION
ECHO A user has logged in the ftp @ %time% on %date%
ECHO Writing to log...
cd %userprofile%/desktop
ECHO --------------------------------------------------- >> FTP_User_Log.txt
ECHO FTP User logged in @ %time% on %date% >> FTP_User_Log.txt
ECHO --------------------------------------------------- >> FTP_User_Log.txt
ECHO Done.
This simple script cannot be executed by wftp in bat or exe form, and i have no idea why. Thanks in advance.
I am using WFTP version 3.3.5. The program i set to run just places a note on the desktop that tells me when someone logged in, so i dont have to dig thru the logs to find out. The reason im sure the program is not being executed is because no note is left on the desktop after a user is logged in. If i run the program by hand, it works perfectly. Here is the entire batch i wanted to run in the event that someone logs in:
@Echo off
TITLE FTP USER NOTIFICATION
ECHO A user has logged in the ftp @ %time% on %date%
ECHO Writing to log...
cd %userprofile%/desktop
ECHO --------------------------------------------------- >> FTP_User_Log.txt
ECHO FTP User logged in @ %time% on %date% >> FTP_User_Log.txt
ECHO --------------------------------------------------- >> FTP_User_Log.txt
ECHO Done.
This simple script cannot be executed by wftp in bat or exe form, and i have no idea why. Thanks in advance.
-
- Site Admin
- Posts: 2083
- Joined: Tue Sep 29, 2009 6:09 am
Re: FTP event, not starting program...
Please change this line: "cd %userprofile%/desktop" into this: "cd c:\"
Maybe not "c:\", but you must write it as a absolute path.
BTW, I finally found this path "%userprofile%/desktop" is a wrong path, so file was save into the installation directory for Wing FTP Server.
Maybe not "c:\", but you must write it as a absolute path.
BTW, I finally found this path "%userprofile%/desktop" is a wrong path, so file was save into the installation directory for Wing FTP Server.
-
- Posts: 3
- Joined: Fri Mar 19, 2010 10:20 pm
Re: FTP event, not starting program...
Okay, I found where the text file is actually being saved! It was located in C:\windows\sysWOW64 and im not real sure why. Additionally, I changed cd %userprofile%/desktop to cd c: and the result is the same, its saved in syswow64. This tells us that its not the syntax of the cd command, something else is happening. I suppose its not really a hassle to link a shortcut to syswow64 but i would like to make this work properly if at all possible. So thanks in advace again admin, your time is greatly appreciated.