Notices
Non Scooby Related Anything Non-Scooby related

NT & .bat Question...

Thread Tools
 
Search this Thread
 
Old 11 October 2000, 08:23 PM
  #1  
Puff The Magic Wagon!
Moderator
Support Scoobynet!
Thread Starter
iTrader: (2)
 
Puff The Magic Wagon!'s Avatar
 
Join Date: May 2000
Location: From far, far away...
Posts: 16,978
Received 15 Likes on 9 Posts
Talking

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 ( ).

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

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 (0 files copied / file access denied)

Permisions/rights should be OK - ideas?

Old 11 October 2000, 10:13 PM
  #2  
IWatkins
Scooby Regular
 
IWatkins's Avatar
 
Join Date: Mar 2000
Location: Gloucestershire, home of the lawnmower.
Posts: 4,531
Likes: 0
Received 0 Likes on 0 Posts
Post

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

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

Cheers

Ian

Old 11 October 2000, 10:27 PM
  #3  
Puff The Magic Wagon!
Moderator
Support Scoobynet!
Thread Starter
iTrader: (2)
 
Puff The Magic Wagon!'s Avatar
 
Join Date: May 2000
Location: From far, far away...
Posts: 16,978
Received 15 Likes on 9 Posts
Talking

Like the thinking - just my sty-lee

Approach from a different angle

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

A thought that had crossed my mind was that NAI (an NT User) did not have access rights to me (GOD! ) at Root but I had (thought) given access to Everyone.

Doh! Ian will report back tomorrow - thanks.
Old 12 October 2000, 08:25 PM
  #4  
Puff The Magic Wagon!
Moderator
Support Scoobynet!
Thread Starter
iTrader: (2)
 
Puff The Magic Wagon!'s Avatar
 
Join Date: May 2000
Location: From far, far away...
Posts: 16,978
Received 15 Likes on 9 Posts
Talking

*&^$^$^

File Access Denied

0 Files Copied

WTF - I am Admin etc.

Any ideas anyone?
Old 12 October 2000, 08:37 PM
  #5  
jjones
Scooby Regular
 
jjones's Avatar
 
Join Date: Apr 1999
Posts: 4,410
Received 1 Like on 1 Post
Post

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


[This message has been edited by jjones (edited 12 October 2000).]
Old 12 October 2000, 10:02 PM
  #6  
Sith
Scooby Regular
 
Sith's Avatar
 
Join Date: May 2000
Posts: 2,706
Likes: 0
Received 0 Likes on 0 Posts
Post

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.
Old 12 October 2000, 10:12 PM
  #7  
ChrisB
Moderator
 
ChrisB's Avatar
 
Join Date: Dec 1998
Location: Staffs
Posts: 23,573
Likes: 0
Received 0 Likes on 0 Posts
Smile

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.
Old 12 October 2000, 10:48 PM
  #8  
Puff The Magic Wagon!
Moderator
Support Scoobynet!
Thread Starter
iTrader: (2)
 
Puff The Magic Wagon!'s Avatar
 
Join Date: May 2000
Location: From far, far away...
Posts: 16,978
Received 15 Likes on 9 Posts
Talking

More ideas - thanks.

Back to the orifice to try tomorrow

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

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
Old 16 October 2000, 11:09 PM
  #9  
simes
Scooby Regular
 
simes's Avatar
 
Join Date: May 2000
Posts: 625
Likes: 0
Received 0 Likes on 0 Posts
Post

Does:

copy c:alert.pag c:

work?

Old 17 October 2000, 08:28 AM
  #10  
Puff The Magic Wagon!
Moderator
Support Scoobynet!
Thread Starter
iTrader: (2)
 
Puff The Magic Wagon!'s Avatar
 
Join Date: May 2000
Location: From far, far away...
Posts: 16,978
Received 15 Likes on 9 Posts
Talking

??

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.
Old 17 October 2000, 04:12 PM
  #11  
LanCat
Scooby Regular
 
LanCat's Avatar
 
Join Date: Jul 2000
Location: cloud cuckoo land
Posts: 536
Likes: 0
Received 0 Likes on 0 Posts
Post

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.


Old 18 October 2000, 05:06 PM
  #12  
dsmith
Scooby Regular
 
dsmith's Avatar
 
Join Date: Mar 1999
Posts: 4,518
Likes: 0
Received 0 Likes on 0 Posts
Post

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).]
Old 18 October 2000, 11:33 PM
  #13  
simes
Scooby Regular
 
simes's Avatar
 
Join Date: May 2000
Posts: 625
Likes: 0
Received 0 Likes on 0 Posts
Post

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
Old 22 October 2000, 10:56 PM
  #14  
CharliePsycho
Scooby Regular
 
CharliePsycho's Avatar
 
Join Date: Sep 2000
Posts: 210
Likes: 0
Received 0 Likes on 0 Posts
Post

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
Old 29 October 2000, 02:00 PM
  #15  
merlin
Scooby Regular
 
merlin's Avatar
 
Join Date: Jul 2000
Posts: 370
Likes: 0
Received 0 Likes on 0 Posts
Post

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.
Old 05 November 2000, 10:05 PM
  #16  
Puff The Magic Wagon!
Moderator
Support Scoobynet!
Thread Starter
iTrader: (2)
 
Puff The Magic Wagon!'s Avatar
 
Join Date: May 2000
Location: From far, far away...
Posts: 16,978
Received 15 Likes on 9 Posts
Talking

Merlin

Spot on

.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

It hasn't gone of yet...

Thanks to Merlin & all others for their help in solving this NT conundrum
Old 06 November 2000, 08:44 AM
  #17  
merlin
Scooby Regular
 
merlin's Avatar
 
Join Date: Jul 2000
Posts: 370
Likes: 0
Received 0 Likes on 0 Posts
Post

Glad to hear this is sorted. You're not the first to be hit by the wonderful NT security model Over the last few years I've talked several major banks through the same issues.

Cheers, merlin
Old 06 November 2000, 08:16 PM
  #18  
mattski
Scooby Regular
 
mattski's Avatar
 
Join Date: Oct 2000
Posts: 1,092
Likes: 0
Received 0 Likes on 0 Posts
Post

shouldn't the combination of NT and security be taken with a pinch of salt ;o)
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Goochie
Computer & Technology Related
10
12 December 2003 03:14 PM
Makalu
ScoobyNet General
16
07 September 2002 12:59 PM
ChrisB
Non Scooby Related
4
15 May 2002 08:51 AM
ChrisB
Insurance
1
03 October 2001 06:43 PM
ChrisB
Non Scooby Related
3
15 May 2001 12:12 PM



Quick Reply: NT & .bat Question...



All times are GMT +1. The time now is 01:10 AM.