The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 05: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 12:02 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #8 (permalink)  
Old 11-18-2008
mohantmk mohantmk is offline
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
  #9 (permalink)  
Old 11-18-2008
mohantmk mohantmk is offline
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
  #10 (permalink)  
Old 12-20-2008
ilan ilan is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 101
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
  #11 (permalink)  
Old 12-20-2008
ilan ilan is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 101
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 (permalink)  
Old 12-21-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 1,009
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 (permalink)  
Old 12-21-2008
ilan ilan is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 101
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 (permalink)  
Old 04-03-2009
eskiphill4 eskiphill4 is offline
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.
Sponsored Links
Closed Thread

Bookmarks

Tags
sftp, sftp windows

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 12:14 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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