School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,146 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,741 people online right now. Registration is fast and FREE... Join Now!




Attempting to pass filename between two batch files

 

Attempting to pass filename between two batch files

rgfirefly24

13 Oct, 2009 - 10:23 AM
Post #1

D.I.C Addict
Group Icon

Joined: 7 Apr, 2008
Posts: 533



Thanked: 17 times
Dream Kudos: 150
My Contributions
I am attempting to use Batch scripts to automate using SFTP through Putty's PSFTP. To do this i have two .BAT files PSFTP.bat and File2.bat

In PSFTP.bat it holds the connection information for the SFTP server and it creates a filename and is supposed to pass it to the 2nd batch file.

The problem is that it doesn't recognize the parameter if i use it in the first .bat file and if i just try and get the date in the second one it says that SET is not recognized by PSFTP.

PSFTP.bat
CODE

SET Today=%date:~10,4%%date:~4,2%%date:~7,2%

SET Filename=Promo_Name

SET FINAL_FileName=%Filename%%Today%

c:\psftp.exe host -l Username -pw Password -b c:\File2bat %FINAL_FileName%



File2.bat
CODE


cd test
cd in

put %1


here is the output as it shows in command prompt:





Attached thumbnail(s)
Attached Image
User is offlineProfile CardPM
+Quote Post


calvinthedestroyer

RE: Attempting To Pass Filename Between Two Batch Files

8 Nov, 2009 - 01:02 PM
Post #2

D.I.C Regular
***

Joined: 13 Oct, 2007
Posts: 287



Thanked: 3 times
Expert In: QBasic, Legos

My Contributions
QUOTE
The problem is that it doesn't recognize the parameter if i use it in the first .bat file and if i just try and get the date in the second one it says that SET is not recognized by PSFTP.


but in your output screen shot You typed in PSFTP.exe not PSFTP.bat.

Question: is PSFTP.bat and File2.bat part of PSFTP.exe's setup files? or are they files that you made?

If they belong to PSFTP.exe (PUTTY) then I would try getting ahold of the author or a PUTTY group?
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 03:49PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month