1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Batch File Problem!

Discussion in 'All Other Software' started by por_supuesto, Sep 12, 2003.

Thread Status:
Not open for further replies.
  1. por_supuesto

    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
     
  2. eddie5659

    eddie5659 Moderator Malware Specialist

    Joined:
    Mar 19, 2001
    Messages:
    35,669
    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
     
  3. drdrew1469

    drdrew1469

    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
     
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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/164225

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice