Register for Semperis' Hybrid Identity Protection (HIP) Conference - June 30 - July 1 Register for Semperis' Hybrid Identity Protection (HIP) Conference - June 30 - July 1

"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.

Register for the Hybrid Identity Protection (HIP) Europe Conference!

Hybrid Identity Protection (HIP) Europe 2021 - Virtual Conference

Mobile workforces, cloud applications, and digitalization are changing every aspect of the modern enterprise. And with radical transformation come new business risks. Hybrid Identity Protection (HIP) is the premier educational forum for identity-centric practitioners. At the inaugural HIP Europe, join your local IAM experts and Microsoft MVPs to learn all the latest from the Hybrid Identity world.