CMD or Powershell Moving - script not working


  1. Posts : 59
    Windows 7 x64 Ultimate
       #1

    CMD or Powershell Moving - script not working


    Code:
    set LISTFOLDER=D:\List\
    set FILESPATH=D:\Igre\COD-MW2\main\images
    set DESTPATH=D:\Igre\COD-MW2\main\images\thepit
    
    REM for /r %LISTFOLDER% %%I in (*.txt) do echo xcopy /qvs "%FILESPATH%\%%~nxI" "%DESTPATH%%%~pnxI"
    for /r %LISTFOLDER% %%I in (*.txt) do xcopy /qvs "%FILESPATH%\%%~nxI" "%DESTPATH%%%~pnxI"
    This script does not work.

    The poster on another fourum said it could be a typo or something, but no further info was provided what the correct script is, although he had no errors, he mentioned it could be environment, I'm on win7 x64.

    I have another similar script for filenames in a txt only, which appears to work, but it doesn't work because I have filespath in the txt, in the meantime i'll manually remove paths to see if it'll work with that, but still this script would be handy to save time in future.
      My Computer


  2. Posts : 59
    Windows 7 x64 Ultimate
    Thread Starter
       #2

    I've got it working a bit more with filenames

    Code:
    @echo off
    
    set FILELIST=D:\List\imageFilenames.txt
    set FILESPATH=D:\Igre\COD-MW2\main\images
    set DESTPATH=D:\Igre\COD-MW2\main\images\thepit
    
    for /f %%X in (%FILELIST%) do call :COPY_FILES "%%X"
    goto :eof
    
    :COPY_FILES
    for /r %FILESPATH% %%I in (%~1) do xcopy /qvs "%%I" "%DESTPATH%%%~pnxI"
    But the error is

    "cannot perform cyclic copy"
      My Computer


  3. Posts : 59
    Windows 7 x64 Ultimate
    Thread Starter
       #3

    Guess I had to choose another drive for destination directory.

    Although a small issue persists, the thing is asking whether the path is a directory or filename for each file, slows the process down considerably.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 05:20.
Find Us