23 Nov, 07:22AM in sunny Singapore!
Home MD C:\MS-DOS

Batch Scripts

Subscribe to Batch Scripts 5 posts

Please Login or Signup to reply.
  • FX_82's Avatar
    118 posts since Apr '02
    • Any MS DOS batch scripts tutorial for renaming files, move files etc pls put under this topic. Wink

  • bryanseb's Avatar
    3,791 posts since Oct '06
    • Originally posted by FX_82:
      Any MS DOS batch scripts tutorial for renaming files, move files etc pls put under this topic. Wink

      For MS DOS, i dun think there is..

  • Moderator
    sand king's Avatar
    17,271 posts since Oct '05
  • FX_82's Avatar
    118 posts since Apr '02
    • Well, there are commands to rename the file based on the current system date and time which can be done.but too bad i am not the pro Rolling Eyes

  • Moderator
    ndmmxiaomayi's Avatar
    53,276 posts since Aug '05
    • There are indeed batch files for it, but given the nature of files, it's very hard to make a batch file for it.

      All users save files in a different way.

      Generally, if you want to rename files and they are in a fixed place, you can refer to this guide so as to save you the time typing.

      Same goes for moving files, that is if you are moving the files to those particular locations.

      General syntax for renaming a file:

      RENAME [drive:][path]filename1 filename2

      So let's say you want this file called whatever.doc to what.doc. Just assume that it's in the root of C drive.

      rename C:\whatever.doc what.doc

      When renaming a file, you can't change the location of the file.

      For moving files, the general syntax is:

      MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination

      Explanation of usage:

      [drive:][path]filename1 - Specifies the location and name of the file
      or files you want to move.
      destination - Specifies the new location of the file. Destination
      can consist of a drive letter and colon, a
      directory name, or a combination. If you are moving
      only one file, you can also include a filename if
      you want to rename the file when you move it.
      [drive:][path]dirname1 - Specifies the directory you want to rename.
      dirname2 Specifies the new name of the directory.

      /Y - Suppresses prompting to confirm you want to
      overwrite an existing destination file.
      /-Y - Causes prompting to confirm you want to overwrite
      an existing destination file.

      So assuming you want to move whatever.doc from C:\ to C:\Windows

      move %systemdrive%\whatever.doc %windir%\whatever.doc

Please Login or Signup to reply.