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
Solved

What is wrong with the attached code?

Posted on 2011-03-15
10
437 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
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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
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 450 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 50 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
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…

808 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