I write a database software by Delphi. DB is SQL Server and has install on server . User save record to bank. For every record there is an attachment file which must be save in server. File must be save in a folder in server and it’s Address must be save in bank.
I write 2 below commands:
ShellExecute(Handle, 'open', 'psexec', '\\18.104.22.168 -u user1 -p hamed123 -c test1.txt' '', SW_HIDE);
CopyFile('test1.txt', '\\22.214.171.124\share_folder$\test1.text, False);
1- Parameter -c test1.txt don’t copy file test1.txt to server . this work be do by CopyFile. But if I don’t write this parameter for psexec, the connection to server will not be open. How can I use psexec for open connection without that parameter?
2- Is there any commands for open connection to server like “psexec”? is “psfile” ? how it work?
3- When a connection be opened by “psexec”, after some seconds, the connection will be closed, Unless copy and paste file between client and server be done frequently. How can we increase the connection time ?
Please reply me full commands for do this work.
Thanks very much