Coming Soon: GET-IT: Endpoint Management 1-Day Conference on September 28th at 9:30 AM ET Coming Soon: GET-IT: Endpoint Management 1-Day Conference on September 28th at 9:30 AM ET

"If not" statement in bath script issue

Home Forums Scripting DOS Command Shell "If not" statement in bath script issue

Viewing 1 post (of 1 total)
  • Author
    Posts

  • igor7
    Member
    #166555

    Hi, There!!
    I need some help with the script I’m going to use as users logon script:


    @echo
    off
    REM Set condition for server
    IF NOT /i %COMPUTERNAME% == LONDON GOTO NEXT
    REM Add printer
    rundll32 printui.dll,PrintUIEntry /in /n\LondonXerox452M
    REM Set printer as default
    rundll32 printui.dll,PrintUIEntry /y /n\London\Xerox45M[/CODE]

    So, the main idea is mapping some printer whenever user logging on to the clients except client with name London
    But in my case “If NOT” statement not worked at all and as result printer not mapped on any client PC’s
    May be I’m missing something here…
    Any help will be appreciated!
    [CODE]@echo off
    REM Set condition for server
    IF NOT /i %COMPUTERNAME% == LONDON GOTO NEXT
    REM Add printer
    rundll32 printui.dll,PrintUIEntry /in /n\LondonXerox452M
    REM Set printer as default
    rundll32 printui.dll,PrintUIEntry /y /n\London\Xerox45M[/CODE]

    So, the main idea is mapping some printer whenever user logging on to the clients except client with name London
    But in my case “If NOT” statement not worked at all and as result printer not mapped on any client PC’s
    May be I’m missing something here…
    Any help will be appreciated!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Live Webinar: Active Directory Security: What Needs Immediate Priority!Live on Tuesday, October 12th at 1 PM ET

Attacks on Active Directory are at an all-time high. Companies that are not taking heed are being punished, both monetarily and with loss of production.

In this webinar, you will learn:

  • How to prioritize vulnerability management
  • What attackers are leveraging to breach organizations
  • Where Active Directory security needs immediate attention
  • Overall strategy to secure your environment and keep it secured

Sponsored by: