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.

Just a simple batch file

Featured Replies

Oki so i SUCK BIG TIME at batch files

i need a batch file that copy 3 files from a dir to an already existing dir (that have a long dirname and spaces) ill figgure ill use XCOPY rather than COPY right?

the 3 files already exists but i want them to be overwritten.

please correct, simpify, make suggestions, remake this cmd for me if you will

cmdow @ /HID

XCOPY /Y file1.txt "%systemdrive%\Program\Dir whit paths\dir whit paths\file1.txt"
XCOPY /Y file2.txt ""%systemdrive%\Program\Dir whit paths\dir whit paths\file2.txt"
XCOPY /Y file3.txt ""%systemdrive%\Program\Dir whit paths\dir whit paths\file3.txt"

EXIT

I know this is a really newbie question but like i said i suck at batchfiles

thanx for any help though

If you're planing to use that batch in an unattended install, I would do place those files in the $OEM$ folder with the right directories under it.

like this: $OEM$/$Progs/yada yada/file1.txt

That's how I would do it :)

Grtz

  • Author
If you're planing to use that batch in an unattended install, I would do place those files in the $OEM$ folder with the right directories under it.

like this: $OEM$/$Progs/yada yada/file1.txt

That's how I would do it :)

Grtz

Okey but does this work when the file in question already exist in the destination dir? (i want it to be overwritten! does it overwrite whitout any question?)

copy /y "file 1.ext" "%systemdrive%\Dir with spaces\Subdir with spaces"

also the /y switch may not be necassary

But if i skip the /y switch i will be asked if i am sure i want to overwrite the existing file right? i just want it to be overwritten whitout any questions!

How would you do such a task Yzöwl???

to overwrite existing files without dos/command prompt asking you questions, you would do something like this:

echo y | copy c:\thisfile.txt d:\

"echo y" will automatically answer YES (y) to the file exist prompt "Overwrite d:\thisfile.txt? (Yes/No/All):" :thumbup

The default behaviour is to prompt on overwrites unless the copy command is being executed from within a batch script, which in this case it is. This would negate the requirement to include it; if you wish to 'cover your bases' however there will be no harm if left in.

  • Author

oki doki

anything special i need to concider when useing long file/dir names and spaces in the dir/filename? do i need to enclose everything with " or just the part whit the long filename/dirname?

and is there any other way of copy the 3 files instead of writing out 3 lines in the batch file with almoast the same command?

some thing like this:

copy file1, file2, file3 c:\bla bla bla\

instead of:

copy file1 c:\bla bla bla

copy file2 c:\bla bla bla

etc....

Edited by Fascix

and is there any other way of copy the 3 files instead of writing out 3 lines in the batch file with almoast the same command?

Take a look at the FOR /F command. You can get some additional information about it by executing HELP FOR from a command prompt.

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.