How to connect SFTP(Linux) from Windows DOS


 
Thread Tools Search this Thread
Special Forums Windows & DOS: Issues & Discussions How to connect SFTP(Linux) from Windows DOS
# 8  
Old 11-18-2008
Hi,

I am getting this error "psftp: unknown command "for"" if i use for /f "tokens=1-3 delims=/ " %%d in ('date /t') do ren test*.txt test%%d%%e%%f.txt

--
Thanks,
Mohan
# 9  
Old 11-18-2008
Iam getting error "psftp: unknown command "for" when iam using for /f "tokens=1-3 delims=/ " %%d in ('date /t') do ren test*.txt test%%d%%e%%f.txt

--
Thanks,
Mohan
# 10  
Old 12-20-2008
Quote:
Originally Posted by mohantmk
Thanks it works. I can run my scripts using "C:\Program Files\PuTTY\psftp.exe" -b "C:\Documents and Settings\Mohan\My Documents\sftpcommands.txt".

I have another doubt it the same script, I need to rename file which iam getting from SFTP, i am not sure the file name which iam getting so iam using "*" but as example iam sending this "ren Test*.txt Test123.txt"

Can you tell me how to rename with date format something like test123[DDMMYYYY][time].

--
Thanks,
Mohan
Mohan, am i late..?

ren Test*.txt "Test%Date:/= % %Time::=.%.txt"

--ilan
# 11  
Old 12-20-2008
Mohan, am i late..?

ren Test*.txt "Test%Date:/= % %Time::=.%.txt"

--ilan

Last edited by ilan; 12-20-2008 at 03:57 AM.. Reason: not sure this my update won't show up in the main page of the thread!! it shows up here :-(
# 12  
Old 12-21-2008
Nice tip ilan, I never knew you could do that kind of substitution in cmd.exe... do you know where that is documented because I can't see it anywhere?
# 13  
Old 12-21-2008
Hi Annihilannic,

I always used this substitution in my scripts to write into error logs; that way I can nail down exactly... what time a particular occured. I got it somewhere online a long back... :-)

--ilan
# 14  
Old 04-03-2009
Grab a copy of PERL from activestate. It is quite easy to automate when you have a real language to work with.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Connect direct - SFTP - List of servers that I can connect

Greetings Experts, I am working for a bank client and have a question on connect-direct and SFTP. We are using Linux RedHat servers. We use connect-direct to transfer (NDM) files from one server to another server. At times, we manually transfer the files using SFTP from one server to another... (2 Replies)
Discussion started by: chill3chee
2 Replies

2. Shell Programming and Scripting

Connect (SSH) to Windows server via Linux server through a script and passing command.. but failing

I am trying to connect to Windows server via Linux server through a script and run two commands " cd and ls " But its giving me error saying " could not start the program" followed by the command name i specify e g : "cd" i am trying in this manner " ssh username@servername "cd... (5 Replies)
Discussion started by: sunil seelam
5 Replies

3. Windows & DOS: Issues & Discussions

Connect to Windows server from Linux

Hi, We are running Linux server and are required to connect to Windows server and fetch the files from windows server. How can i connect to Windows server from Linux? I have to do this with a automated shell script on Linux I appreciate your response. (4 Replies)
Discussion started by: reachmexyz
4 Replies

4. Shell Programming and Scripting

Connect to Windows from Linux using NetCat

Hi Need help to connect from Ubuntu to Windows using NetCat nc I can not get my script to send new-line Her is what I have tried(sleep 2 ; echo user ; sleep 1; echo pass; sleep 2; echo netstat) | nc -t 10.10.10.34 23 gives this outputÿý%ÿûÿûÿý'ÿýÿýÿûWelcome to Microsoft Telnet Service ... (1 Reply)
Discussion started by: Jotne
1 Replies

5. Ubuntu

Steps to connect linux (Ubuntu) machine from windows 7

Hi, Can anyone give me the steps to connect ubuntu from windows7? Thanks (1 Reply)
Discussion started by: diehard
1 Replies

6. Linux

Help!! trying to connect to linux SSH from windows putty client

Hi, i am trying to connect my Putty session on a windows box to a linux SSH, i have generated private and public key pairs using puttygen, i have set the public one to be in an OPENSSH format... and have put this in my authorized_keys file in linux, when i connect i get the following errors: ... (1 Reply)
Discussion started by: Jtyreman
1 Replies

7. Shell Programming and Scripting

Transfer files from linux server to windows using secure ftp (sftp)

HI, I have to transfer files from linux server to windows using secure ftp (sftp) .Kindly help me out. (3 Replies)
Discussion started by: manushi88
3 Replies

8. Shell Programming and Scripting

Connect to Oracle in Windows XP from Linux HOST

Hi everyone, I have oracle 9i installed in Windows XP and i have ubuntu in VM WARE. I would like to know how to connect to Oracle in windows xp from Linux through shel scripting...... (3 Replies)
Discussion started by: Zimbu
3 Replies

9. UNIX for Advanced & Expert Users

How do I connect windows xp to Linux Red hat unix

I just bought a new pc and my unix software is installed on my old computer. I want to take the hard disk outta my old pc and then install it on my new pc so my new pc has 2 hard drives. now, after my pc new has 2 hard drives, one being unix the other being windows xp, i want to be able to... (7 Replies)
Discussion started by: TRUEST
7 Replies
Login or Register to Ask a Question