The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
.
google unix.com



Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
need script to connect sftp servers kittusri9 Shell Programming and Scripting 1 05-10-2008 05:13 AM
how to connect sftp server using script kittusri9 Shell Programming and Scripting 1 05-06-2008 07:12 AM
how to connect to windows from unix ? guhas Shell Programming and Scripting 2 12-19-2005 04:37 PM
Connect from Windows Using SSH aldowsary AIX 12 08-07-2005 03:12 PM
How do I connect windows xp to Linux Red hat unix TRUEST UNIX for Advanced & Expert Users 7 11-21-2002 11:02 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #8 (permalink)  
Old 11-18-2008
Registered User
 

Join Date: Nov 2008
Posts: 9
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
Reply With Quote
  #9 (permalink)  
Old 11-18-2008
Registered User
 

Join Date: Nov 2008
Posts: 9
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
Reply With Quote
  #10 (permalink)  
Old 12-20-2008
Registered User
 

Join Date: Jul 2007
Posts: 96
Quote:
Originally Posted by mohantmk View Post
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
Reply With Quote
  #11 (permalink)  
Old 12-20-2008
Registered User
 

Join Date: Jul 2007
Posts: 96
Mohan, am i late..?

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

--ilan

Last edited by ilan; 12-20-2008 at 02:57 AM.. Reason: not sure this my update won't show up in the main page of the thread!! it shows up here :-(
Reply With Quote
  #12 (permalink)  
Old 12-21-2008
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 996
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?
Reply With Quote
  #13 (permalink)  
Old 12-21-2008
Registered User
 

Join Date: Jul 2007
Posts: 96
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
Reply With Quote
  #14 (permalink)  
Old 04-03-2009
Registered User
 

Join Date: Oct 2008
Location: Pacific Northwest
Posts: 12
Grab a copy of PERL from activestate. It is quite easy to automate when you have a real language to work with.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Bookmarks

Tags
sftp, sftp windows

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:




All times are GMT -4. The time now is 09:15 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66