is it possible to make a bat file that waits for a remote command that is cross-domain? that way I can set up a bat file on my computer at home that clicks accept (for chrome remote desktop) when I send the remote command.
Related
Before scheduling script it is worth to check how it works. so from Command Prompt I have just run my batch file.
The server rejected SFTP connection, but it listens for FTP
connections. Did you want to use FTP protocol instead of SFTP? Prefer
using encryption.
Image:
As shown in the image above, I have specified that It is FTP file protocol. But It doesn't help.
So far I have looked up:
https://winscp.net/eng/docs/message_server_rejected_sftp_listens_for_ftp
https://winscp.net/eng/docs/ui_login
And It works fine on FileZilla as FTP. Therefore, I can eliminate the following possibilities:
Server unexpectedly closed network connection;
Network error: Connection refused;
Network error: Connection reset by peer;
Network error: Connection timed out.
And here is my .bat for reference:
C:\Program Files (x86)\winSCP\winSCP.com" /script="C:\test\Test.txt
And .txt:
option batch abort
option confirm off
open ***.**.**.**
lcd C:\Transfer\ToABCTest\
get -delete /test_edi_in/*.txt
close
exit
You have to specify the FTP protocol in the script using the ftp:// scheme in the session URL:
open ftp://***.**.**.**
I am creating a batch file to open a RDP session.
The remote desktop uses a gateway, so there are 2 credentials to be entered.
One for the gateway and other for the remote desktop.
I have written the following code:-
cmdkey /generic:gateway/abc.com /user:user1 /pass:password1
cmdkey /generic:TREMSRV/10.2.13.4 /user:user2 /pass:password2
start mstsc /v:10.2.13.4
But on running this code the pop to enter first set of credentials appears. I want to hardcode the credentials in the batch file itself
Can anyone suggest how shall i accomplish this ?
I need some help with batch file. I am using windows 7.
I need a batch file to:
Open VPN Client on my PC, path is
("C:\Program Files (x86)\Cisco Systems\VPN Client\vpngui.exe)
There are 5 VPNs in the list. Connect to vpn name (AA_VPN) using my username and password
A window pop ups when I connect - that is 'continue or discontinue'
3. The process should press 'continue' button or spacebar key (all works)
And then the batch file should close itself.
Thanks.
From documentation:
"C:\Program Files (x86)\Cisco Systems\VPN Client\vpnclient" connect AA_VPN user <yourUser> pwd <yourPassword>
I am coding a program in C# to communicate with a remote PC in an Wifi AdHoc network. I execute a BATCH file in the remote that will send to the local a CHECK.txt file. I use PsExec.
Everything works fine in my C# program when I execute this batch file remotely with PsExec from the local PC to copy the CHECK.txt file in any of the remote's directories. The problem comes when I modify this BATCH to copy the text file to the LOCAL:
copy C:\Windows\CHECK.txt \\192.168.1.10\C$\Windows
It seems that the process PsExec, used to execute the BATCH in remote, blocks the communication of the network when the BATCH tries to send back to the local the text file. Ports 445 and 139 problem? Any idea of what is blocking the file to be sent back?
Everything is set for a transparent dialog between remote and local (no firewall, etc).
Thanks in advance...
I just noticed the -s parameter on your PSEXEC command. The -s means Run the remote process in the System account.. Removing it should allow your batch script to write back to local computer.
I am currently writing a script that calls WinSCP, connects an SFTP session, transfers a group of files from a local server to a remote server, closes the connection, then moves the local file to an archive. An alternate acceptable solution would be to copy the file to archive and then delete it from the source directory.
The problem I am having is that I can get WinSCP to open, connect and transfer the files, but after that the commands are ignored and I am unable to automate the connection close, file move or copy and the deletion and closing of command prompt. What is the best way to do this?
My FTP.bat file that connects the session and calls the script -
"C:\Program Files\WinSCP\WinSCP.exe" /console /command "lcd d:\bofa_ftp\out" /script=script.txt savedsession#winscpname.com
My script file that puts the file and closes the connection -
option batch abort
option confirm off
option exclude script.txt
put *.txt
close
When I add any commands to either the bat or the script they are ignored.
Commands after close are definitely not ignored. Your problem might be that you are trying to put Windows commands to WinSCP script. Note that there are no commands in WinSCP to move local files.
Instead of trying using Winscp3, try with plink.exe.
Plink is the best option to transfer files from winscp3 to your local.By using scp command we can transfer file from winscp to local as well as one folder in to another folder in winscp.
scp username#atechguideserver1.com:/data/tmp/samplscp.txt username#atechguideserver2.com:/data/tmp/dir/tech
Please refer to: http://99students.com/move-files-in-unix/