Need a quick Batch file. I'm not good with commands. Help

Hello Experts,

I need a batch file.  When I execute the batch file it should copy a file from on location directly to the c:\ drive.  Then when it's done copying that file, I need to execute it.  Can you help me with that?
rdabateAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lee W, MVPTechnology and Business Process AdvisorCommented:
What file?  Where is it?

copy \\server\share\path\to\file\to\copy\file.exe c:\
file.exe

More information might yeild a better answer - what are you trying to do?
rdabateAuthor Commented:
File to be copied to C drive: \\fp\support\Patches\XP Sp2\test.exe

O, one more thing.  Is it possible to specify, if the file already exist on C, cancel the whole command and don't execute?
Lee W, MVPTechnology and Business Process AdvisorCommented:
If Not Exist "\\fp\support\Patches\XP Sp2\test.exe" copy "\\fp\support\Patches\XP Sp2\test.exe" c:\
test.exe
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

rdabateAuthor Commented:
I don't think I understand that last comment and commands.

So if I were to create that batch file and double click it it would:
Look to see if file from \\fp\support\Patches\XP Sp2\test.exe is allready on C
If it is, cancel the whole command
If it isn't, copy file to C, then run file.
Lee W, MVPTechnology and Business Process AdvisorCommented:
Are you doing this through a domain?  Are you trying to update systems with Service Pack 2?  Why not just deploy with Group Policy or WSUS?
Lee W, MVPTechnology and Business Process AdvisorCommented:
That said, yes, I screwed up on that last post.


If Exist "c:\test.exe" Goto End
copy "\\fp\support\Patches\XP Sp2\test.exe" "C:\"
c:\test
:End

If the file already exists on C:, then the batch skips to lines and goes to the :End label - which avoids copying and running it.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rdabateAuthor Commented:
Yes it is for sp2.  We have software here for windows updates.  Program is called UpdateEXPERT.  It works great, but sp2 is giving all kinds of errors.  I'm kind of in a rut and need to get pc's updated ASAP.  So instead of fighting with the updateexpert program, I'm trying to do get it done another way.  I've never rolled out updates with Group Policy or WSUS.
Lee W, MVPTechnology and Business Process AdvisorCommented:
Group Policy is easy to use to update a SP - other updates, not so easy.  WSUS is Microsoft update tool - you really might want to take a look at it.

Reference:
http://www.windowsnetworking.com/articles_tutorials/Group-Policy-Deploy-Applications.html
rdabateAuthor Commented:
leew, thanks for all the help.  I'll check out that article.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.