how to create a batch file to pull a file off

September 14, 2010 at 10:15:15
Specs: Windows XP
how to create a batch file to pull a file off a pc's desktop and place in a server file

This is what I started trying...

@echo off
net use f:\\esb1107\Documents and Settings\jlk\Desktop
net use x:\\shared\dailyin\test\
copy f:\test.xls x:\test1.xls


See More: how to create a batch file to pull a file off

Report •

#1
September 14, 2010 at 10:43:33
i suggest you use ftp, you say "Server" but a shared folder is not a server..
anyhow:
you will need 2 files (execute.bat and script.txt)
in script script.txt:
open websitehere.com
username
pass
cd (go in a folder)
get <<File.ext>> (or Put to send files)
bye
:::end of script.txt

And execute.bat

@echo off
echo Send and get files...
ftp -s:script.txt
echo Done!

That was the script


Report •

#2
September 14, 2010 at 10:51:23
It is a share on a server..... I want to automate a prosess..... daily..... I want to take a pdf off a desktop and put in into a share on a server and rename the pdf...

Report •

#3
September 14, 2010 at 11:08:38
So, if it's a server it should be able to handle ftp!
Just use my script

Report •

Related Solutions

#4
September 14, 2010 at 11:27:42
Not sure where the presumption that all servers = FTP servers came from...


This should work (assuming that this is for the currently logged on user):

@echo off
cd %homepath%\desktop
copy "filename.pdf" "\\full\share name\here\newfilename.pdf"

Ah, I see you're trying to do this on two remote machines. Where does your current batch fail? The only issue I see is

A) Missing quotes around your paths when setting the drive letters and a missing space between the drive letter and path.

B) It assumes Documents and Settings is a shared folder. Usually not the case. If not, and you are a local admin on the machine you can change to

net use f: "\\esb1107\C$\Documents and Settings\jlk\Desktop"


Report •

#5
September 15, 2010 at 15:47:57
Replace:
net use f:\\esb1107\Documents and Settings\jlk\Desktop
net use x:\\shared\dailyin\test\

With:

net use f: "\\esb1107\Documents and Settings\jlk\Desktop"
net use x: \\shared\dailyin\test\


Report •

#6
September 15, 2010 at 18:56:10
Thanks for all the help..... the bat file works just like i wanted.......

Report •

Ask Question