ScoobyNet.com - Subaru Enthusiast Forum

ScoobyNet.com - Subaru Enthusiast Forum (https://www.scoobynet.com/)
-   Non Scooby Related (https://www.scoobynet.com/non-scooby-related-4/)
-   -   NT & .bat Question... (https://www.scoobynet.com/non-scooby-related-4/16056-nt-and-bat-question.html)

Puff The Magic Wagon! 11 October 2000 08:23 PM

We have an Internet Paging System to give work to our couriers. As a resourceful sort of chap, I now want it to alert me should I get a virus ( http://bbs.scoobynet.co.uk/mad.gif ).

We run NAI/Dr. Solomons & one of the options is to "on finding a virus" run a program.

Therefore, I have created a very simple batch file to

<B>@echo off
copy c:alert.pag q:</B>

This copies a pre-determined file (Quick There's a Virus u Plonker!) to a directory where the pager software takes it & sends it to me in a paging message.

Simple http://bbs.scoobynet.co.uk/smile.gif

Problem is...

If I do it from a cmd prompt - it works.
If I do it by Run command - it works.
If I do it by d/click on pager.bat in explorer - it works.
If I do it via NAI/Dr Solomons it doesn't work http://bbs.scoobynet.co.uk/frown.gif (0 files copied / file access denied)

Permisions/rights should be OK - ideas?


IWatkins 11 October 2000 10:13 PM

PTMW

I'm going to guess that the anti-virus software is smart and is thinking that when it runs this program that it is possibly doing more damage, so denies system level access to other drives while in "You have a Virus" mode. Maybe http://bbs.scoobynet.co.uk/wink.gif

I don't remember wht system we have in HQ but it actually locks the whole file system up until the action required is performed by the Admin.

Another option is to try and run this application from the Q drive.

I.e. put the following .bat in the a directory on the Q drive that the paging software doesn't see, i.e. Q:jobsvir_warn.bat

@echo off
q:
copy c:alert.pag q:alert.pag

or similar.

This will probably not work as my .bat file skills went out of the window at the same time as DOS http://bbs.scoobynet.co.uk/wink.gif

Cheers

Ian


Puff The Magic Wagon! 11 October 2000 10:27 PM

Like the thinking - just my sty-lee http://bbs.scoobynet.co.uk/smile.gif

Approach from a different angle http://bbs.scoobynet.co.uk/smile.gif

With a few mods that could work... (in theory) as rights access NT doesn't come into it - just have to worry 'bout rights access Novell http://bbs.scoobynet.co.uk/rolleyes.gif

A thought that had crossed my mind was that NAI (an NT User) did not have access rights to me (GOD! http://bbs.scoobynet.co.uk/wink.gif ) at Root but I had (thought) given access to Everyone.

Doh! Ian will report back tomorrow - thanks.

Puff The Magic Wagon! 12 October 2000 08:25 PM

*&^$^$^

File Access Denied

0 Files Copied

WTF - I am Admin etc.

Any ideas anyone?

jjones 12 October 2000 08:37 PM

Puff,

Before I start I have no qualifications in NT/Novell or any OS but may have a couple of ideas to try - but they well be ant chuff

I had a prob on NT4 - i was trying to write a batch file to change paths coz im lazy.

any how a
cd windows
would work fine , however a
cd windowssystem32
would not.

running the command on 2 lines i.e.
cd windows
cd system32
worked fine.

you could try to convert the batch file to a com file - there used to be a bat2com utility (i seem to remember from the dark ages of DOS V5 (not included with DOS))
and try running that. Or maybe bang up a small prog in VB or like to do the copy. I could bang one up for you if you do not have the resources. the vb route would require the vb runtime files to be installed on that machine tho. (5mb ish)

failing that uninstall the anti virus software http://bbs.scoobynet.co.uk/smile.gif


[This message has been edited by jjones (edited 12 October 2000).]

Sith 12 October 2000 10:02 PM

PTMW,

Been reading your first post a couple of times. When you say "Run a program". I think it means an exe or com file. This has already been suggested.

A batch file is just that. A batch of comands.

An exe file is a program run command and can be a program all in itself. (Hope I'm not teaching to suck eggs. Appols if I am.)

I would as suggested turn it into an exe file and see if it runs.

I certanly would not have thought it to be access rights as A) your an admin and B) you can run it manually.

And having read it again, does the AV software require a path statement as it replies with 0 files copied. Does the AV software know where to find this file it is meant to be copying and activating.

It is a little hard to work out via BBS and not seeing the problem first hand. IMO

A few suggestions which I hope work.

P.

ChrisB 12 October 2000 10:12 PM

Here's an idea....

Is NetShield or VirusScan service running under a different user account from when you test it?

Does that user have permissions to write a file to the Q drive? As it's trying to copy the file, I would guess that it has got sufficient read/execute privs on the batch file.

Can you log as the user under which the NAI services are running and try to copy the file to Q?

Cheers,

Chris.

Puff The Magic Wagon! 12 October 2000 10:48 PM

More ideas - thanks.

Back to the orifice to try tomorrow http://bbs.scoobynet.co.uk/smile.gif

With the use a tank to crack an egg system, I allocated every user group mega access+ on both the .bat & the target - no good http://bbs.scoobynet.co.uk/frown.gif

No apparent AV user account...

All re-writes of the .bat work (but not under AV). File is R/W

Task tomorrow is to run scheduler (Resource Kit one) & see what occurs...

This is now a matter of PTMW! over NT/Novell rather than practical usage (added to which, Foxpro program which should do more or less the same for a Gateway crash, also fails to work...[tho' I haven't yet seen the code on it]).

Joy http://bbs.scoobynet.co.uk/smile.gif

simes 16 October 2000 11:09 PM

Does:

copy c:alert.pag c:

work?


Puff The Magic Wagon! 17 October 2000 08:28 AM

??

Not copying a file to itself?

copy c:alert.pag d: works at a cmd prompt

Doesn't work as an executed batch file from Dr Solomons.

LanCat 17 October 2000 04:12 PM

Puff

Couple of things off the top of my head.

I don't know the av s/w but I think you need to step through it a bit at a time to try and eliminate a bit at a time.

From reading the thread it's not clear whether the copy problem is reading the file or writing it.

Try changing the batch file to

type c:alert.pag

and see if it displays on screen.

If it does then the problem is your destination directory. Probably permissions but maybe there is a file in the directory already that it can't overwrite?

If it doesn't then you know you have a read problem, almost certainly permissions.

Lot's of NT apps use the SYSTEM account to run stuff... check that it has rights to the files and directories.



dsmith 18 October 2000 05:06 PM

I'm no LAN admin - prefer to stick to IP design. but I agree with LANCAT - it sounds as if the account which the NT app uses when it runs, does not have the appropriate Novell rights to write the file. Maybe it's just a local NT account on that one machine with no Novell equivalent.

Is the AV s/w running on an NT Server or Workstation (the C: ) ? Is the q: a Novell or NT shared drive ?

Regards
Dean

[This message has been edited by dsmith (edited 18 October 2000).]

simes 18 October 2000 11:33 PM

I assume the solomons or whatever stuff is running as a service, with logon as system or whatever it's called radiobutton on.

In which case try checking the interact with desktop box, this has solved problems like this in the past for me.

Good luck

Simon

CharliePsycho 22 October 2000 10:56 PM

PTMW,

From what I can gather you are copying a file to a network drive...

Try mapping the drive first in the batch file...

NAV usually runs under the system account, which unless you have set it up will have no mapped drives.

Cheers...
...CharlieP

merlin 29 October 2000 02:00 PM

I've seen similar problems before. What's happening is that the AV software is running as a NT Service which by default uses the NT System user account. This user only has access to resources on the local machine, ie. the c: drive and any other partitions setup locally. If it attempts to access a network drive, then you will get an access denied error.

One solution is to change the user account that the AV software is using. This can be done by going to the NT Control Panel and selecting the Services applet. You then need to identify which service is the one that is running the bat file. Hopefully from the services names it should be possible to work out which one is the AV software. Now click on the Startup pushbutton. In the dialog box that pops up, you can specify the user account that you have used in the past to successfully copy files to the Novell machine. Alternatively click on the pushbutton with the three '...' and select the user there. You will also need to give the password & confirm the password for the user specified. Once you have specified the user that the service will use, stop and restart the service. Hopefully the service will now be able to copy files to the Novell box. If it still doesn't work, then it's probably because the batch file specifies a q: drive which isn't mapped when the batch file is run by the service. I haven't played with a Novell box, so this may not work, but I would try changing the bat file to use the name of the Novell box, for example:

copy c:alert.pag \novellboxnameshare

You could also try:

net use q: \novellboxnameshare
copy c:alert.pag q:

If you're still having problems, check the NT event system and applications logs as well as any log provided by the AV software. Hope this helps.

Puff The Magic Wagon! 05 November 2000 10:05 PM

Merlin

Spot on http://bbs.scoobynet.co.uk/smile.gif

.bat (or .cmd as it ended up) reads

@ echo off
copy c:alert.pag \novellservervolumedirectorysubdirectory

Now that that works, its also been re-worked to page me should various critical services fail & other such things http://bbs.scoobynet.co.uk/smile.gif

It hasn't gone of yet...

Thanks to Merlin & all others for their help in solving this NT conundrum http://bbs.scoobynet.co.uk/biggrin.gif

merlin 06 November 2000 08:44 AM

Glad to hear this is sorted. You're not the first to be hit by the wonderful NT security model http://bbs.scoobynet.co.uk/wink.gif Over the last few years I've talked several major banks through the same issues.

Cheers, merlin

mattski 06 November 2000 08:16 PM

shouldn't the combination of NT and security be taken with a pinch of salt ;o)


All times are GMT +1. The time now is 03:41 PM.


© 2024 MH Sub I, LLC dba Internet Brands