.bat works for me but nobody else?

Dell ?
January 5, 2009 at 06:42:44
Specs: Windows XP SP2, P4
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
C

set 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 *.RPT

for /f "skip=2 delims=" %%a in ('dir /b /a:d /o:-d 2^>NUL') do rmdir /s /q "%%a"



See More: .bat works for me but nobody else?

Report •


#1
January 5, 2009 at 09:51:56
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.


Report •

#2
January 5, 2009 at 10:43:48
cmd /e:on

maybe??


Report •

#3
January 5, 2009 at 21:43:00
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.


Report •

Related Solutions


Ask Question