1.

Solve : 2 questions - Move inc subs + some harder question.?

Answer»

Question 1 is prob easy for most of u , but i couldn't figure out how ..

1 I got this code.
move "C:\something\something\"* "C:\something2\something2"
Instead of moving only files in the main dir , i want to move everything ( including SUBFOLDERS and " files inside the subfolders")
How can you do such thing?

2.
Is it possible to get the total size of your folder ( including subfolders / files) and log it in a txtfile as 1 line ( so only 'like : 400kb)
The thing i tried out now would put a whole list of things in the txtfile , but i only want the totalsize , so i can compare the size as logged in txtfile with the size the BATCH will find at that moment.

Thankyou ,here's a vbscript
Code: [Select]Set objFSO = CreateObject("Scripting.FileSystemObject")
strFolder = "c:\test"
strDestination = "c:\temp"
' Move the whole folder to destination
objFSO.MoveFolder strFolder,strDestination & "\test"
' Get folder size
WScript.Echo "Folder: " & strFolder & " is " & objFSO.GetFolder(strFolder).Size & " bytes."
save it as myscript.vbs or anything, and from command prompt:
c:\> cscript /nologo myscript.vbs
Sorry for perhaps being a little unclear before.
But instead of moving the whole folder itself , i only want to move all files and subfolders (with files) inside it..

The map itself should remain writable under the action ( thats why)

But i REALLY appreciate your time and effort! ,

I am saying this with a coke in my left hand , and a doughnut in my right
what hand is typing?




then use copy, not move. Since you are drinking coke and eating doghnut, i think I will get some too. So i will leave you to do the code yourself. If you need references, check this outI think i am not far from it , but still aint there"

I got this:

dir "C:\target\folder" /S /B > dirnames.log
type dirnames.log
for "%i" in (dirnames.log) do move "%i" "C:\destination"




The txtfile it creates look like this:
C:\target\folder\submap1\submap2\
C:\target\folder\submap1\submap2\file.txt
C:\target\folder\file.txt


like you can see the data in the txtfile would be EXACTLY what i wanna move .. i only don't know how to read the txtfile lines and move those.
I think i aint that far from it .. but can't figure it out . -> That why i hope some1here knows it







(i don't know if i could move those maps like in this way , but i should atleast be able to move all files that are included in subdirs
by just doing : dir "C:\target\folder" *.* /S /B > dirnames.log ( something like that)



Discussion

No Comment Found