Batch File Problem!

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

por_supuesto

Thread Starter
Joined
Sep 12, 2003
Messages
1
I have to admit to knowing hardly anything about batch files, but i am currently tring to get a network audit program to run on every pc within the network using a batch file in a login script.

I have been sucessful in getting the program to run. The trouble is that i cant take the batch file out of the login script until everyone in the network has logged on and auditted their pc.

Any users that have completed the audit of their machine are fine until they log-off. Upon logging-on again the program reappears prompting them to them to audit their computer again, i expected this would happen.

What i want to happen is the batch file to recognise that the audit program has been run and information (ie the audit files) has been sent to a particular directory or even simply that the batch file has been run previously on this computer and thus does not run again.

Anyone who knows of a way of doing this please help!
Thanks in advance
por__supuesto
 

eddie5659

Moderator
Malware Specialist
Joined
Mar 19, 2001
Messages
37,277
Hiya and welcome

Just bumping this up, as I'd like to see how this is done :)

Also, which version of Windows are you running these on?

Regards

eddie
 
Joined
Nov 30, 2000
Messages
436
I'm assuming, with what you posted, that each machine will have it's own audit file in a specific directory, correct? If that is true, you will need to grab environmental variables (ev) from that machine and use these ev in an "IF EXIST" statement, (Win9x) for example:

@ECHO OFF

\\Server\Netlogon\Putinenv L > nul
\\Server\Netlogon\Winset Username=%Username% > nul
\\Server\Netlogon\Winset Computername=%Computername% > nul

IF EXIST \\Server\AuditDirectory\%COMPUTERNAME%.txt GOTO END

AUDITCOMMAND

This is basically saying, if you find this computername in the server's audit directory, the audit has been run and you can quit, otherwise run my audit commands. For 9x machines you will need two files (Putinenv & Winset) to grab the ev information. You won't need these for NT machines. Let me know if you want me to email them to you (very small files). Let us know some of the questions we've asked you and maybe post your code for us to look at...I'm feeling very nostalgic all of a sudden...

Hope that helps,

Drew
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top