You are not logged in.

#1 19 Sep 2014 15:52

haru072000
New Member
Registered: 19 Sep 2014
Posts: 3

Access is Denied when running a batch file

Hi All,

Im running windows server 2000, it ive been scratching my head over this as 1 user raised a concern on why he cant run a batch job. then I run a test and heres what I got.
As you can see I cant run a "type" on the cmd/bat file, however renaming it to a text file is ok. The most important thing is I can't run it.

G:\>type outbound.cmd
Access is denied.

G:\>move outbound.cmd outbound.txt

G:\>type outbound.txt
echo "Starting the movement of files"
mv D:\apps\folder\*.*  F:\QA\folder\
echo"End"

G:\>move outbound.txt outbound.cmd

G:\>type outbound.cmd
Access is denied.

G:\>outbound.cmd
Access is denied.

Offline

#2 19 Sep 2014 16:08

foxidrive
Member
Registered: 04 Apr 2013
Posts: 339

Re: Access is Denied when running a batch file

mv is not a system command.

echo"End" will give you an error.

Offline

#3 19 Sep 2014 16:12

haru072000
New Member
Registered: 19 Sep 2014
Posts: 3

Re: Access is Denied when running a batch file

thanks for reply. but the batch file is not even running it says access is denied. you wont even see the echo command.

Offline

#4 19 Sep 2014 16:37

foxidrive
Member
Registered: 04 Apr 2013
Posts: 339

Re: Access is Denied when running a batch file

if you use an admin account does it run?

Offline

#5 19 Sep 2014 17:58

haru072000
New Member
Registered: 19 Sep 2014
Posts: 3

Re: Access is Denied when running a batch file

yep, I am the administrator, sad

Offline

#6 20 Sep 2014 03:35

Aacini
Member
Registered: 05 Dec 2012
Posts: 149

Re: Access is Denied when running a batch file

I could bet that you downloaded the outbound.cmd file from a site via a "download" button. This happened to me some times. It seems that Windows detects that the downloaded file is an executable file, and prevents its execution. My solution is to select all the text of the original file and "copy" it, and then "paste" it in a new outbound.cmd file created locally.

You may also fix the downloaded file via this line:

G:\>type outbound.txt > outbound.cmd

Antonio

Offline

#7 20 Sep 2014 07:05

foxidrive
Member
Registered: 04 Apr 2013
Posts: 339

Re: Access is Denied when running a batch file

Aacini wrote:

I could bet that you downloaded the outbound.cmd file from a site via a "download" button. This happened to me some times.

It happens here too - but also to admin accounts and the OP says it works for him.

It would seem to me to be a permissions issue.  Maybe drive G: is a special location, or the user has limited rights in the root folder.

Offline

Board footer

Powered by