Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi
I've got the following script that works if I run it but not if any ther user does.
It's used just to create a folder convert some files and switch to a different drive and do the same.
However if someboy else try to run this script it converts the files and creates the 1st folder but then won't copy the files as it cannot find the new folder.
ANY IDEAS???
Thanks
Cset source=T:\Adhoc\Import\Contracts
Echo Input folder Name
set /p Name=Echo Input Month to Archive to
set/p Month=cd /d "Old\%Month% 2009"
mkdir %Name%
pushd %source%xcopy "*.RPT" "Old\%Month% 2009\%Name%"
xcopy "*.PDF" "Old\%Month% 2009\%Name%"
xcopy "*.PDF" "S:\Operations\Corporate Services\Distributions and HMRC\Distributions\Daily Contract Notes\"
xcopy "*.RPT" "S:\Operations\Corporate Services\Distributions and HMRC\Distributions\Daily Contract Notes\"del *.PDF
del *.RPT
cd /d "S:\Operations\Corporate Services\Distributions and HMRC\Distributions\Daily Contract Notes\"mkdir %Name%
xcopy "*.RPT" "%Name%"
xcopy "*.PDF" "%Name%"cd /d "S:\Operations\Corporate Services\Distributions and HMRC\Distributions\Daily Contract Notes\"
del *.PDF
del *.RPTfor /f "skip=2 delims=" %%a in ('dir /b /a:d /o:-d 2^>NUL') do rmdir /s /q "%%a"

Ok the thing that sticks out is your using mapped drives, I would recommend using UNC path ex:\\servername\folder just incase someone that runs the file doesn't have the same drive letter mapped to that folder. Try that and see if it helps.

I am not sure whether this applies to XP.
But in my Vista, bat files does not execute if there is no entry for bat in pathext env. var. Check whether there is a environment variable by the name pathext. It should have .BAT in it. May be it is missing or spoiled?c:\holla>set pathe
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PSC1--
Holla.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |