[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

What is wrong with the attached code?

Posted on 2011-03-15
10
Medium Priority
?
443 Views
Last Modified: 2012-05-11
¿I want to write a batch file that would copy a  .bak file  to a folder on a shared drive.
The code I tried is attached. I set it up to run in task scheduler. I get a success message, however nothing happens.
How can I edit this code to it will run correctly?

BTW- I use the  correct IP address in the code    Thanks
copy "F:\SharepointBackups\TESTcontentschedule.bak" "\\IPaddress\shared$\Backups\Sharepoint"

Open in new window

0
Comment
Question by:PDSWSS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 6

Expert Comment

by:tangchunfeng
ID: 35144489
make sure you saved the password for the remote host
or add
net use \\192.168.1.199 /user:administrator passwd_of_admin
0
 

Author Comment

by:PDSWSS
ID: 35144559
Is this correct?

net use\\ipaddress\shared$\Backups\Sharepoint/user:administrator password
0
 
LVL 6

Expert Comment

by:tangchunfeng
ID: 35144566
yes
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 5

Expert Comment

by:Khalid Mehmood Awan
ID: 35144583
You may use attached exe... I have been using it for years for synchronizing two folders on network.
But read its help by typing
SYNC /? when u are in its directory on command prompt.
 sync.exe
0
 

Author Comment

by:PDSWSS
ID: 35144589
Thanks. Concerns me to send my admin password in open text like that. Is there another way?

How would I save the password for the remote host instead?
0
 
LVL 6

Expert Comment

by:tangchunfeng
ID: 35144615
net use  \\ipaddr\sharedir   /user:administrator  passwd /persistent:yes,
0
 
LVL 6

Expert Comment

by:tangchunfeng
ID: 35144623
no need to add in the batch file
run net use /persistent:yes once on your machine
0
 

Author Comment

by:PDSWSS
ID: 35144636
Thanks. I'll test that. Run 1X in the cmd prompt. Correct?

Is there a way to encrypt the password?
0
 
LVL 6

Accepted Solution

by:
tangchunfeng earned 1800 total points
ID: 35144672
run it in cmd prompt

net use  \\192.168.1.199  /user:administrator  /persistent:yes

you will be prompted for the password

no way to encrypt the password in the batch file as far as I know.

0
 
LVL 5

Assisted Solution

by:h4mi
h4mi earned 200 total points
ID: 35146029
For encryption you can make an Autohotkey script and compile it with a password phrase to make an .exe file that's difficult to decompile :

run, "net use \\ipaddr\sharedir /user:administrator passwd /persistent:yes"

download from www.autohotkey.com
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question