Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Need Some Batch File Help

Featured Replies

i used to use a cmd file to auto-backup, and auto-restore my personal settings (eg - my docs, my pics, my music, outlook express accounts, outlook express settings).

i lost the file, and am trying to re-write it.

however, for some reason, "my documents" aren't copying over properly - they copy to "C:\Documents and Settings\Administrator\My Documents", but the desktop "my documents" icon leads to an empty folder. (and there is ONLY one account on the comp - the admin one, created by defualt with xp).

Can someone check over my batch and tell me what's wrong?

CLS
@echo off
TITLE N Restore

ECHO.

for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\Backup set BACKUP=%%i:
ECHO Found Backup as drive %BACKUP%.

ECHO Copying My Documents...
XCOPY "%BACKUP%\My Documents\*.*" "%UserProfile%\My Documents\" /E /Q /Y
ECHO Done.


ECHO Copying Outlook Express Settings...
regedit /s "%BACKUP%\N Outlook Express.reg"
ECHO Done.


ECHO Copying Outlook Express Address Book...

ECHO Done.


ECHO Copying Firefox Bookmarks...

ECHO Done.


PAUSE
goto :eof


try chaning to this..

XCOPY "%BACKUP%\My Documents\"

(remove the *.*)

XCOPY "%BACKUP%\My Documents" "%UserProfile%\My Documents" /ECIQY

<Edit>

Changed due to previous lack of sleepthanks a06lp

</Edit>

Edited by Yzöwl

  • Author

ok, new q:

I also want to create a backup cmd file. This is a litle more complicated.

The first thing I want it to do is check if the folder "My Documents" exists on %BACKUP%. IF it does, I want it renamed as "My Documents (mm-dd-yy)".

Same with bookmarks.html (IF it exists, then it becomes bookmarks (mm-dd-yy).html)

and Administrator.wab (IF it exists, then it becomes Administrator(mm-dd-yy).wab).

The other thing i need it to do is to go into the "%systemdrive%\Documents and Settings\Administrator\Application Data\Mozilla\Firefox\Profiles" directory, get the folder name from in there (a random string of chars), then go into that directory, and copy the bookmarks.html to the %backup%.

Can anyone help me with this?

[edit]

by the way, @Yzöwl:

that code is incorrect - it copies all the stuff into %UserProfile%, not into My Documents.

the modified, and correct, code is:

XCOPY "%BACKUP%\My Documents" "%UserProfile%\My Documents\" /ECIQY

Edited by a06lp

Here is a VBS script modified it to your needs.

Note

All Array Start At Zero

The Red Text Is The Array Where You Want To

Place Your Information. Remove ' These From Before The

Text To Make Active, Plus Remove The Green Text To Avoid Conflicts

Green Text Can Be Removed It There just As A Test

Purple Text Are Location As Varibles

Dim Act, ApData, Fso, MozDir, Moz, UserP

  Set Act = CreateObject("Wscript.shell")

  Set Fso = CreateObject("Scripting.FileSystemObject")

    UserP= Act.ExpandEnvironmentStrings("%UserData%")

    ApData = Act.ExpandEnvironmentStrings("%APPDATA%")

    Sd = Act.ExpandEnvironmentStrings("%Systemdrive%")

    MozDir = ("I:\Firefox bookmarks\script test")

'  Moz = Array((ApData & "Mozilla\Firefox\Profiles\8loakqo3.default\bookmarks.html"),_

'  (MozDir & "\bookmarksBak.html"))

    Moz = Array(("C:\TestMe.txt"),(SD & "\Testme.txt"))

  If Fso.FileExists(Moz(0)) Then

    Fso.CopyFile(Moz(0)),(Moz(1))

  Else

    Act.Popup "Cannot Find This File" & vbCrLf & Moz(0), 5, "Error Missing", 0 + 32

  End If

If You Run The Above Script Without Any Modifications,

And Missing This Location C:\TestMe.txt, It Will Display

A Error message, If it There Then It Moves It To SystemDrive.

Thread With More Examples

  • Author

i dont know any vbs.

i was hoping for batch file. can you help?

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.