Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: CMD or Powershell Moving - script not working

14 Aug 2013   #1
Stewox

Windows 7 x64 Ultimate
 
 
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 System SpecsSystem Spec
.
15 Aug 2013   #2
Stewox

Windows 7 x64 Ultimate
 
 

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 System SpecsSystem Spec
15 Aug 2013   #3
Stewox

Windows 7 x64 Ultimate
 
 

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 System SpecsSystem Spec
.

Reply

 CMD or Powershell Moving - script not working




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Fix Powershell has stopped working error
Hi there, when I'm using my Windows 7 Home Premium 64bit computer; and when using it (in general, not noticed it to happen at any specific time) an error message shows up saying "Powershell has stopped working" followed by "A problem caused the program to stop working correctly. Windows will close...
Software
Windows Powershell has stopped working
Been getting this error for about 3 weeks. Windows Powershell has stopped working. Went to the event viewer and here is what I found... Fault bucket , type 0 Event Name: PowerShell Response: Not available Cab Id: 0 Problem signature: P1: powershell.exe P2: 6.1.7601.17514 P3:...
Software
powershell script to create user folders and set permissions
Wondering if anyone in this forum can help me figure out what I am doing wrong with my script. I am grabbing a text file with a list of users in it. I want to then create folders for all those people and then set explicit permissions on those folders to only allow the users and admin access to it....
Software
A script to automate moving files off C: prior to backup?
I back up my files and system image weekly. I move the recorded TV shows (broadcast TV, nothing illegal) before that from my hard drive onto an external drive. Another drive in the same cabinet does the backup. It saves time and I won't want those files after a disc failure anyway. It would be...
General Discussion
PowerShell logon script
Ok, so this doesn't necessarily have to do with Windows 7, but I originally wanted to reply to a post on Vista forums and somehow I ended up here. Anyway... I actually tried all of this on Windows Server 2008 - set policies, scripts and logged on there. Here's one way that actually works. 1)...
Network & Sharing
Java Script is not working corretly after sp1
Hi all After updating by windows update to sp1, i have massage that java sript is not working correctly on my pc. I don't know why. I didn't switch it off, did not changed any system settings. Because this java, i can't run for instance McAfee installer. It displays the massage and only option is...
Software


Our Sites

Site Links

About Us

Find 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 14:09.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App