Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi 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', '\\194.168.35.1 -u user1 -p hamed123 -c test1.txt' '', SW_HIDE);
CopyFile('test1.txt', '\\194.168.35.1\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
Posted
Comments
Zoltán Zörgő 27-Jan-13 7:18am    
I didn't get your point why you need psexec at fist place. If I understand you correctly you want to copy a file to a server share that needs different user to be authenticated as the one running the application. Psexec can do this for you but not this way, actually this is not the tool for it. Do you need a solution in Delphi? And what version? Do you make native code, or .net?
armm1388 27-Jan-13 23:16pm    
yes i want code in delphi

1 solution

Take a look here[^] for correct use of the options, and help forum.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900