Operating System - HP-UX
1828214 Members
2330 Online
109975 Solutions
New Discussion

sftp : changing windows directory from unix

 
so.nimda
Super Advisor

sftp : changing windows directory from unix

Hi,

How do I change the windows directory from unix while doing sftp in batch mode?

Here's the scenario :

I am running a unix sftp script in batchmode to mget files in a windows server. The challenge I'm facing is how do I change the windows directory to get the files? The files are residing in "f:\direcory1\directory2\" in the windows server.

The sample script as follows :
sftp -o "batchmode yes" -b batchfile

batchfile :
cd \directory1\directory2\
mget datafiles*
bye

Seems like unix doesn't know how to change windows directory.

Can someone advise?

Thanks in advance.
6 REPLIES 6
Prasanth V Aravind
Trusted Contributor

Re: sftp : changing windows directory from unix

why can't you try for a scp ?

Gudluck
Prasanth
Prasanth V Aravind
Trusted Contributor

Re: sftp : changing windows directory from unix

your user root dir should be f:

then you do cd /directory1/directory2


Gudluck
Prasanth
AnthonySN
Respected Contributor

Re: sftp : changing windows directory from unix

you need to do
lcd f:\direcory1\directory2\
when you are in unix server
so.nimda
Super Advisor

Re: sftp : changing windows directory from unix

Thanks Prasanth & SASJ for your replies.

Unfortunately, both your suggestion didn't work.

From unix, I am using the script to connect to the windows server to get the files. The issue here is that
the files residing in Windows is not in the default c: drive but f: drive.

How can I do a "cd" to f: drive to copy the files from windows to unix?
so.nimda
Super Advisor

Re: sftp : changing windows directory from unix

Hi all,

Some updates :

After investigating, found that it was a mistake on my part, should not have "cd \directory1\directory2\" as it was already logged in to f: drive.

Using "cd directory1\directory2" solved it.

Thanks all for the help.
so.nimda
Super Advisor

Re: sftp : changing windows directory from unix

As in my previous post.