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




Similar help and support threads
Thread Forum
Help me integrate a Powershell script into the context menu
Hi all, I want to add a custom entry to the right-click context menu so that I can send a copy of a file to a predetermined folder on a remote computer. This idea is based on a tutorial. I stored a Powershell script in C:\context-menu.ps1. There should only be one argument (which is the file's...
General Discussion
Is there a powershell script for turning off power saving on all devs?
I have lots of USB devices on several hubs but more importantly, shit happens and I need to turn off that horrid Power Management feature that allows devices to be turned off to save power. Does anyone have a script to run through all the PC devices and uncheck that feature where it exists? CHEERS!
Hardware & Devices
Powershell script to count file types
Hi all, forgive me if this is the wrong folder. I am googling scripts to find a PS script to count file types and files in several directory's on our network. I am a noob on powershell, and I'm trying to experiment. I have several directory's on my "Libraries" directory on my pc at work. I'm...
General Discussion
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
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


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 17:17.
Twitter Facebook Google+