Page 1 of 1
[WINDOWS] How do I create a basic script?
Posted: August 27th, 2012, 4:30 pm
by tjadonis
I have been googling and reading for hours but I can't make this work..
I want to have a script which moves everything from my complete folder to my movies folder as soon as the files have processed
i made a batch file like this:
@echo on
cd C:\Documents and Settings\Administrator\My Documents\Downloads\complete
move *.* d:\movies\
pause
but it doesnt work, I have tried a lot of different combinations of this, but I always get 'syntax error' or such like
I've tried it with the directory string in inverted commas and allsorts
Please can someone highlight the very obvious mistake I must be making here?!?!
Thanks
Re: [WINDOWS] How do I create a basic script?
Posted: August 27th, 2012, 4:55 pm
by sander
"cd C:\Documents and Setting.." won't work. Try it out on the command line and you will see it ...
Solution:
C:
cd \Documents and Setting...
As a rule of thumb: first try commands on the command line to see if it works. Then put it in a .BAT file, and run that from the command line. And only then run it from SAB.
Furthermore:
move *.* d:\movies\
... does that work? WIll it move subdirectories? I have no Windows so I can't check for you.
PS: moving to another directory can be done by SAB based on (default) category. Maybe easier.
Re: [WINDOWS] How do I create a basic script?
Posted: August 27th, 2012, 5:06 pm
by tjadonis
thanks for the reply
move *.* d:\movies\ - no, this doesnt work. none of it does.
i keep trying it on the command line, but i cant get it to run - i am stuck
Re: [WINDOWS] How do I create a basic script?
Posted: August 28th, 2012, 12:32 am
by sander
Probably easier to create a Category and assign a destination directory to it ...
Re: [WINDOWS] How do I create a basic script?
Posted: September 1st, 2012, 3:35 pm
by GasMan320
Try this:
@echo on
C:
cd \Documents and Settings\Administrator\My Documents\Downloads\complete
XCOPY * /E /Y /C D:\movies\
DEL /S /Q *
RMDIR /S /Q .
See if that works. Should copy all the contents and then delete the files and subdirectories in your complete folder.
Re: [WINDOWS] How do I create a basic script?
Posted: September 1st, 2012, 4:21 pm
by shypike
Shouldn't that be?
xcopy /e /s /y
Re: [WINDOWS] How do I create a basic script?
Posted: September 1st, 2012, 4:27 pm
by GasMan320
Hey shypike,
Correct me if I'm wrong but I think /E by itself is equivalent to using /E /S together.
Re: [WINDOWS] How do I create a basic script?
Posted: September 1st, 2012, 5:59 pm
by clinton hall
To be safe I would use
@echo on
c:
cd "\Documents and Settings\Administrator\My Documents\Downloads\complete"
XCOPY * /E /Y /C D:\movies\
DEL /S /Q *
RMDIR /S /Q .
Using "" prevents issues with the spaces in the directory name. I see the first post indicates this was tried, so presumably the move was where the problem occurred, but I would leave the directory string in quotes and try the xcopy commands.