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