MSFN Forum: My Actual Letter To A Batch File Expert - MSFN Forum

Jump to content


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

My Actual Letter To A Batch File Expert Rate Topic: -----

#21 User is offline   XtremeMaC 

  • MSFN SuperB
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5,070
  • Joined: 13-October 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 13 December 2003 - 12:59 AM

if u're talking about what to do with this
@echo off
echo Backing up folder and files...
xcopy C:\Program Files\Common Files\MSSoap\*.* c:\backup\ /s /e /c /q /h
echo finished backup.
echo beginning removal of original...
rd C:\Program Files\Common Files\MSSoap /s /q
echo removal complete

you could just save it in a batch file say copyndelete.bat
and just run it
but if you want to do something else
cd\ will get you to the root of c drive
cd.. (2 dots) will get you to one lower level of directory


#22 User is offline   Bold_Fortune 

  • Member
  • PipPip
  • Group: Members
  • Posts: 221
  • Joined: 05-December 03

Posted 13 December 2003 - 01:03 AM

Nope. If I make it into a bat file, it doesn't work.

#23 User is offline   XtremeMaC 

  • MSFN SuperB
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5,070
  • Joined: 13-October 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 13 December 2003 - 01:20 AM

hmm maybe your windows cannot process the full paths
try them with
@echo off
echo Backing up folder and files...
cd\
md backup
xcopy C:\Progra~1\Common~1\MSSoap\*.* c:\backup\ /s /e /c /q /h
echo finished backup.
echo beginning removal of original...
rd C:\Progra~1\Common~1\MSSoap /s /q
echo removal complete


also it might be bc he didn't create the folder backup in root c
I added it...

This post has been edited by XtremeMaC: 13 December 2003 - 01:27 AM


#24 User is offline   IcemanND 

  • MSFN Junkie
  • Group: Super Moderator
  • Posts: 3,266
  • Joined: 24-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 13 December 2003 - 01:21 AM

what doesn't work, exactly? It worked great in my test.

#25 User is offline   XtremeMaC 

  • MSFN SuperB
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5,070
  • Joined: 13-October 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 13 December 2003 - 01:27 AM

u didn't create the backup folder I guess
no my bad xcopy creates it itself I forgot about that...

This post has been edited by XtremeMaC: 13 December 2003 - 01:28 AM


#26 User is offline   Bold_Fortune 

  • Member
  • PipPip
  • Group: Members
  • Posts: 221
  • Joined: 05-December 03

Posted 13 December 2003 - 01:30 AM

Darn. Okay, I'm supposed to make the backup folder on C:\ ..right? What do I name it? Then I take that and save it as a bat file to my desktop ...right? Double-click on it, and it should work ...right?

#27 User is offline   IcemanND 

  • MSFN Junkie
  • Group: Super Moderator
  • Posts: 3,266
  • Joined: 24-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 13 December 2003 - 01:36 AM

save contents of code box above by extrememac to doit.cmd (if you are not using 2000 or xp, then doit.bat) wherever you want to keep it. you do not have to create any folders. then double click on the file and away you go.

#28 User is offline   Bold_Fortune 

  • Member
  • PipPip
  • Group: Members
  • Posts: 221
  • Joined: 05-December 03

Posted 13 December 2003 - 01:39 AM

XtremeMaC, on Dec 13 2003, 01:20 AM, said:

hmm maybe your windows cannot process the full paths
try them with
@echo off
echo Backing up folder and files...
cd\
md backup
xcopy C:\Progra~1\Common~1\MSSoap\*.* c:\backup\ /s /e /c /q /h
echo finished backup.
echo beginning removal of original...
rd C:\Progra~1\Common~1\MSSoap /s /q
echo removal complete


also it might be bc he didn't create the folder backup in root c
I added it...

This one worked. But it only backed-up the contents of the MSSoap folder, not the folder itself. In other words it backed up Binaries, the sub-folder of MSSoap, and it's contents.

#29 User is offline   IcemanND 

  • MSFN Junkie
  • Group: Super Moderator
  • Posts: 3,266
  • Joined: 24-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 13 December 2003 - 01:43 AM

change c:\backup\ to c:\backup\MSSoap\

then c:\backup will contain a mssoap folder with everything inside it that was previously inside backup with the previous script.

#30 User is offline   Bold_Fortune 

  • Member
  • PipPip
  • Group: Members
  • Posts: 221
  • Joined: 05-December 03

Posted 13 December 2003 - 01:50 AM

I new this would happen if we really got into it. So thanks for your patience, guys.

I'm lost again. "change c:\backup\ to c:\backup\MSSoap\"

Which line is that on? Here's what I copied:

@echo off
echo Backing up folder and files...
cd\
md backup
xcopy C:\Progra~1\Common~1\MSSoap\*.* c:\backup\ /s /e /c /q /h
echo finished backup.
echo beginning removal of original...
rd C:\Progra~1\Common~1\MSSoap /s /q
echo removal complete

One more thing. Could these lines be replaced for me with something I can understand a little better: "C:\Progra~1\Common~1\MSSoap\ " ? See, If I wanted use this bat file to for a different folder, I would not know how to insert it there. Can it read simply "C:\Program Files\Common Files\MSSoap" ?

#31 User is offline   IcemanND 

  • MSFN Junkie
  • Group: Super Moderator
  • Posts: 3,266
  • Joined: 24-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 13 December 2003 - 02:00 AM

ok, last try. There is only one c:\backup\ in the file. ?!?!?

this location is your destination, where it all gets backed up to. whatever you have there whether it is c:\backup\ or c:\backup\mssoap\ or c:\backup\myjunk\ in the xcopy line this is the destination. Just end it with a \ or it will ask you a question.

Now if you want to backup a diffewrent folder change
c:\progra~1\common~1\mssoap in then xcopy line and in the rd line. this is the source directory, what you are backing up and then removing.

the file is just a simple text file, open it in notepad.

Quote

Can it read simply "C:\Program Files\Common Files\MSSoap" ?

try it if it works then yes. May need to enclose it in " ".

#32 User is offline   Bold_Fortune 

  • Member
  • PipPip
  • Group: Members
  • Posts: 221
  • Joined: 05-December 03

Posted 13 December 2003 - 02:04 AM

IcemanND, I don't think I can do this. I'll just request this and see if you will do it for me. Will you make what I need? I mean just make it. I'm having such a hard time understanding this.

#33 User is offline   Bold_Fortune 

  • Member
  • PipPip
  • Group: Members
  • Posts: 221
  • Joined: 05-December 03

Posted 13 December 2003 - 02:12 AM

I think he got frustrated with me and left. I can understand that. Can any else make what I need and post it for me. I really don't understand all the explainations. I don't mean to frustrate anyone.

#34 User is offline   Bold_Fortune 

  • Member
  • PipPip
  • Group: Members
  • Posts: 221
  • Joined: 05-December 03

Posted 13 December 2003 - 02:59 AM

I finally got it. Just took you guys 18 hours to get it through to me. This is what I finally came up with, and it is just what I wanted.

@echo off
echo Backing up folder and files...
cd\
md backup
xcopy "C:\Program Files\Common Files\MSSoap\"*.* c:\backup\MSSoap /s /e /c /q /h
echo finished backup.
echo beginning removal of original...
rd "C:\Program Files\Common Files\MSSoap" /s /q
echo removal complete

Figuring out the \" on the xcopy line, and the " with no slash before it on the rd line was a bit tricky for me. But I made a lucky guess.

Hey, thanks ever-so-much for your time and trouble. Even though you all seemed to walk away in the end. LOL. But I can understand your frustration with me. Thanks again.

#35 User is offline   LeveL 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 551
  • Joined: 30-September 05

Posted 29 August 2008 - 03:55 PM

Wow this is where it all started huh.

I don't have Bold's link in my sig for nothing.

I can see how people made it incredibly awkward here explaining things to Bold.

But its 5 years ago so who cares.

Theres only one thing I could suggest to help - use variables not definite paths, because in reality a variable is a more definite path (safer really, if you ever want to use those batch files on another system where Windows might not be installed to C:)

So, example:

MOVE /Y "C:\Documents and Settings\USERNAME\Application Data\Microsoft\Credentials" "C:\MyBackup"

This could and in my opinion should say:

MOVE /Y "%APPDATA%\Microsoft\Credentials" "%SystemDrive%\MyBackup"

Thats about it.

This post has been edited by LeveL: 29 August 2008 - 03:57 PM


Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy