Get default printer share name

Can someone give a code snippet of how to get the default printer share name?
I'm able to get the printer name with the following but can't get the share name.
    private void listClientPrinters(PrintService[] pServers) {
        for (int i = 0; i < pServers.length; i++) {
            javax.print.PrintService ps = pServers;
write_message("Client Printer "+i+": "+ps.getName());
}Thanks,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

hi,
Please refer the code elow..u should be able to crack this roblem..
  data: l_usr01 like usr01.
  CALL FUNCTION 'GET_PRINT_PARAM'
    EXPORTING
      I_BNAME = sy-uname
    IMPORTING
      E_USR01 = l_usr01.
  output_options-TDARMOD = '1'.
  output_options-TDDEST = l_usr01-spld.
  output_options-TDRECEIVER = sy-uname.
  output_options-TDCOPIES = '1'.
  output_options-TDIMMED ='X'.
  output_options-TDDELETE = 'X'.
  output_options-TDLIFETIME = 0.
  output_options-tdnoprev = 'X'.
  output_options-tdnoprint = space.
  output_options-tddelete = 'X'.
Please, assign points, if u have found it useful..
Thanks,
Nivin

Similar Messages

  • How to Get Default Printer from ITS

    Hi all,
    I want to get the default printer name when i run application thru ITS ..
    I have function module  RSPO_FRONTEND_PRINTERS_FOR_DEV   which shows the default printer available in the system but it is in SAPGUI and which dont work for ITS applications.
    Does any body knows the function which brings Default printer in ITS .  I appreciate your answers . I Appreciate your responses.
    Thanks
    Pradeep Reddy

    With PrintGetPrinters(), I can get all printer in the list. If it is a bug, where to get the patch for 11.5?
    My pb build is 11.5.1 4608.
    Also, another alternative solution to get default printer with pb 11.5.1?
    Another is: is Pb 11 and Pb 12 can be installed on windows XP side by side?

  • Get default printer in ABAP program ....

    Hi gurus, pls help me ...
         I had a program to print voucher. It show document list, and user can choose some document to print (smartform). Now, if I choose 5 document, I have to choose printer 5 times. Who can tell me the way to get default printer of the desktop which user's using to assign OUTPUT_OPTIONS or something like that!? Thanks for all.

    hi,
    Please refer the code elow..u should be able to crack this roblem..
      data: l_usr01 like usr01.
      CALL FUNCTION 'GET_PRINT_PARAM'
        EXPORTING
          I_BNAME = sy-uname
        IMPORTING
          E_USR01 = l_usr01.
      output_options-TDARMOD = '1'.
      output_options-TDDEST = l_usr01-spld.
      output_options-TDRECEIVER = sy-uname.
      output_options-TDCOPIES = '1'.
      output_options-TDIMMED ='X'.
      output_options-TDDELETE = 'X'.
      output_options-TDLIFETIME = 0.
      output_options-tdnoprev = 'X'.
      output_options-tdnoprint = space.
      output_options-tddelete = 'X'.
    Please, assign points, if u have found it useful..
    Thanks,
    Nivin

  • Customizing default PRINT SCREEN names

    i've been googling this for a year and a half now and cannot find the documentation someone referred me to in order to get the PRINT SCREEN names in mac customized.
    right now if i take a screenshot before noon it and then a series of screenshots after noon the one in the AM will show up before the one in the PM. i forget if this had to do with the location of the TIME or if it was occuring with the AM/PM designation but we were pretty quickly able to alter this so that they showed up correctly.
    anyone know where this is?
    TIA

    hi baltwo.
    i wonder if anyone has an answer to this that doesn't involve applescript. i have to read these documents again but one seemed to indicate that you can only change the prefix (say to "pictures") but i am not sure if this is only applicable to one or another OS. i will be moving to Mountain Lion soon so if there is a fix in ML that doesn't involve applescript it would be great. i am not sure i want to go through the hassle of doing an applescript on this and maybe just put in a suggestion and keep my fingers crossed for fixing this in a new OS. my impresssion from your links (/thanks/ again, is that i may have fixed this in Snow Leopard and been living with it since in Lion...).
    anyway, i got some time to document it so it is explained below in terms of what the problem is...
    Screen Shot 2013-06-14 at 10.26.12 AM.png
    Screen Shot 2013-06-14 at 12.52.01 PM.png
    Screen Shot 2013-06-15 at 4.32.46 PM.png
    Screen Shot 2013-06-15 at 10.06.59 AM.png
    Screen Shot 2013-06-15 at 12.45.36 PM.png
    Screen Shot 2013-06-15 at 12.45.56 PM.png
    Screen Shot 2013-06-15 at 12.55.07 PM.png
    this is the order of my screenshots with theTHIRD item in the list obviously being a screenshot taken /after/ the last four items in the list taken on the same day. this is obviously because "4" PM is howing up before "12" PM. it also means that a screenshot taken at "8" AM will show up /between these two when it was obviously taken before.
    this is a big hassle if i have taken 50 screenshots in a day and i have to find one that i took at some point in the afternoon. i obviously use screenshots a lot and they are a great help so having them disordered like this is a pain. also, if i sort by date created (instead of "Name" i am finding that i have the same problem since the order is dependant on the NUMBERING and the numbering is X:XX in some cases and XX:XX in others. also, i think the AM needs to precede the XX:XX to fully fix this from what i recall (so that shots taken in the AM show up first and shots taken in the PM show up second and /then/ they get ordered numerically).
    i would like to change TERMINAL in some way to fix this as opposed to running an applescript and will be upgrading from Lion to Mountain Lion soon so if there is a way to do this in ML that would be great...

  • Why do I keep getting default printer not supported?

    I have had my printer for aprox.three years without a problem, now I get default printer not supported and printer not activated error code 30

    Hi there,
    Could you provide the community with a little more information to help narrow troubleshooting? Things like your printer model and your operating system help out a lot.
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • Cannot get default printer to operate correctly

    No matter what I do, the default printer is not the one that comes up when I want to print from Pages - is there some switch or setting I need to click besides setting one printer as the default printer?

    John,
    It's a bug in Pages. It seems that if you make your first save with a different printer, you can never get it to go back to your default printer. You have no idea how disconcerting it is to issue the print command to my 400-page manuscript, and watch it start spewing it out on address labels.
    -Dennis

  • Printer share name gets renamed when saving with -1

    Often (but not always) when I change a seemingly unrelated setting (like channel, encryption, NTP...) the printer name gets appended with " - 1"
    Canon MP780 FAX - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1
    Is the current name. This is really frustrating people as you might imagine and confusing to boot.
    What's up?

    BUMP I'm also trying to do the same thing and also experiencing the same issues!

  • Getting default Public Folder names again

    I just installed Leopard and updated to 10.5.4. I set up two users both as Admins. When I set up File Sharing, both user's public folders, were already installed, and were named "[username]'s Public Folder". This was great as they both showed up with their different respective names when accessed.
    I then changed the User Names of both Admin accounts. The second user Admin account automatically changed the Public Folder's name (in the file sharing section), to match the new User Name but the first Admin account did not, retaining the original User Name I had given the main Admin account. Trying in vain to get it to change to match, (you can't rename the public folder there), I removed it from the shared folder field and added it back. While successful, it now only has the name "Public" rather than "[username]'s Public Folder".
    Can anyone help me get the original OS default name back again?

    I see. as I said I don't know how to do it properly but you can try the follwoing (admittedly clumsy) workaround.
    Rename your public folder. It's not quite easy to do actually because that folder is protected by a deny delete ACL and you won't be able to rename it without some extra work.
    First run the following command in terminal ( from the same account as that Public folder) to remove the ACL.
    chmod -N ~/Public
    You can now rename it as you like. Let's say you call it
    Joe's Public folder
    (or whatever). You can put the deny delete ACL back if you want to protect that folder from accidental deletion as it was by default. to do that run the following terminal command
    chmod +a "everyone deny delete" ~/"Joe's Public folder"
    keep the quotes in the command. I'm not sure if there is any downside to doing this. It might be that the name of the Public folder is hard coded somewhere and renaming it will have some unintended consequences. I tested it on one of my accounts and everything seems to work fine there but something might still come up later. If it does you can always rename the folder back to Public.

  • How to get default SMTP server name

    Hi,
    I want to know the name default SMTP server configured in machine. How i can get this through my java code.
    Help me on this

    You can find STMP server configured in hostname, in ask to dns of domain who is mailserver, you need to find MX records :
    - look a DNS config : NS (name server) , CNAME (Alias) , MX (mailexchange) etc...
    import java.util.ArrayList;
    import java.util.Hashtable;
    import javax.naming.*;
    import javax.naming.directory.*;
    public class MXLookup
         public static void main(String args[]) throws NamingException
              System.out.println(getMX("altern.org") + " mail servers");
         private static ArrayList getMX(String hostName) throws NamingException
              // Perform a DNS lookup for MX records in the domain
              Hashtable env = new Hashtable();
              env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");
              DirContext ictx = new InitialDirContext(env);
              Attributes attrs = ictx.getAttributes(hostName, new String[] { "MX" });
              Attribute attr = attrs.get("MX");
              // if we don't have an MX record, try the machine itself
              if ((attr == null) || (attr.size() == 0))
                   attrs = ictx.getAttributes(hostName, new String[] { "A" });
                   attr = attrs.get("A");
                   if (attr == null) throw new NamingException("No match for name '" + hostName + "'");
              ArrayList res = new ArrayList();
              NamingEnumeration en = attr.getAll();
              while (en.hasMore())
                   String x = (String) en.next();
                   String f[] = x.split(" ");
                   if (f[1].endsWith(".")) f[1] = f[1].substring(0, (f[1].length() - 1));
                   res.add(f[1]);
              return res;
    }

  • Cifs oes2sp1 linux Default Share names

    Why is it the default Volume Share name always show up when I restart cifs.. especially _ADMIN volume. I tried to use iManager to remove them, also use cifsnov -srn from server console. It seems to work until cifs restart and they show up again. Any ideas? Thank you.

    Sept 2013, OES11 sp1 : Still Not Fixed.
    Also, FYI, if in iManager I remove the default shares where the sharename is the same as the volume name and I add a specific share where the share name is different from the volume name and it accepts that and it presents that just as expected then the CIFS server should NOT be auto adding the shares I have removed. This is especially vexing when using junctions between two volumes on the same server.
    Please ONLY share the volumes I have explicitly exported via iManager. NO MORE DEFAULT SHARES! Please and Thank-you.
    Ron

  • Need print program name

    Hi all,
    i have smartform name .how we will find print program?
    What is the output type and application for paychek?
    please tell to me..
    Thanks,
    kisho.re

    there are two ways
    go to table TNAPR give ur smartform name and then u will get your program name
    secondly if any putput type is associated with it then go to transaction NACE select application area then click output type and then get the print program name
    ~hitesh

  • Replication issues: Operations Master shows ERROR and attempting to connect to server shares gets "the target account name is incorrect"

    I think this should be easily resolved, but I need some guidance.
    I have a client with 2 Server 2003 R2 x64 DCs: BORIS & NATASHA. Last year I upgraded both of them from x86 to x64 one at a time, allowing replication to occur between the upgrades. BORIS is the FSMO roles holder as it is currently the production server,
    while NATASHA is a backup DC. One thing that puzzles me though is that if I look at the NS record in DNS on the SOA tab, it says NATASHA is the Primary server.
    While doing some routine maintenance I noticed an error in the File Replication Service events about a 'Tombstone' situation (Event ID 2042). I looked at article cc757610 in the Technet Library and opted for remedy #3 as I did not want to demote NATASHA
    and I got confused looking at the help about using "repadmin /removelingeringobjects". I have no idea how to determine which DC has the good copy of the directory.
    Now, in running "repadmin /showrepl" I get
    "DC=CPA,DC=local
        Default-First-Site-Name\BORIS via RPC
            DC object GUID: 0267a090-1890-40e2-9a15-ea928cabd425
            Last attempt @ 2012-12-27 08:28:55 failed, result -2146893022 (0x80090322):
                The target principal name is incorrect.
            1179 consecutive failure(s).        Last success @ 2012-12-21 23:30:15." <-- THIS IS WEIRD SINCE THIS IS THE DATE THAT I DISCOVERED THE TOMBSTONE EVENT AND MADE THE REGISTRY CHANGE
    (I THINK).
    When I try to look at the FSMO roles on NATASHA, it shows ERROR for RID, PDC & Infrastructure and says "The current Operations Master is offline. The role cannot be transferred." The other issue I'm having is that client PCs are intermittently having
    trouble reconnecting to necessary server shares.
    TIA
    Wayne S. CompTIA A+ CompTIA Network+ Microsoft MCP

    Hello Sandesh,
    I spent a lot of time trying to understand using NETDOM to reset machine account passwords (don't understand it yet), but I see that you're saying that won't work anyway.
    I'm not really sure how to tell which DC is the broken one, but I'm assuming it's BORIS since that's the one users are unable to connect to. Since it is the FSMO role holder and GC I want to make sure I understand the steps correctly:
    1.Use dcpromo to forcefully demote BORIS
    2.Do metadata cleanup on NATASHA (using ntdsutil?)
    3.Promote BORIS again to DC
    Should I leave NATASHA as the FSMO role holder and GC? BORIS is the better (more resources/faster processor) machine and it's the file server. Or should the better machine be the FSMO role holder and GC as well as the file server. NATASHA is meant to be
    a backup in case BORIS dies.
    Thanks,
    Wayne S. CompTIA A+ CompTIA Network+ Microsoft MCP www.InfoTek831.com
    Hi,
    The step you are performing is correct but you also need to seize the FSMO role on other DC if BORIS is FSMO role holder and configure authorative time server role.You can later move the famo role to  BORIS server the choice is your however if you are
    moveing the role then you need configure authorative time server on BORIS server.
    Configuring the time service on the PDC Emulator FSMO role holder
    http://msmvps.com/blogs/acefekay/archive/2009/09/18/configuring-the-windows-time-service-for-windows-server.aspx
    Domain Replication has exceeded the tombstone lifetime
    http://pmeijden.wordpress.com/2011/01/12/domain-replication-has-exceeded-the-tombstone-lifetime/
    Forcefull removal of DC:
    http://support.microsoft.com/kb/332199
    How to transfer or seize FSMO roles
    http://sandeshdubey.wordpress.com/2011/10/07/how-to-transfer-or-seize-fsmo-roles/
    Metadata Cleanup of a Domain controller
    http://sandeshdubey.wordpress.com/2011/10/12/metadata-cleanup-of-a-domain-controller/
    Once both server is online check the health of DC by running dcdiag /q and repadmin /replsum.Ensure that DNS/GC role is configured on both DC's
    Hope this helps
    Best Regards,
    Sandesh Dubey.
    MCSE|MCSA:Messaging|MCTS|MCITP:Enterprise Adminitrator |
    My Blog
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • Default Printer name in Smartforms

    Hi Experts,
    When I am displaying Smart forms, an automatic popus is getting displayed which asks for current Printer.I am using LP01 as default printer.Can I hide this popup so while the user executes the program,he can directly view the Report screen.
    regds,
    Sam.

    DATA :  LF_FORMNAME           TYPE TDSFNAME ,  " Smart Forms: Form Name
                            LF_FM_NAME            TYPE RS38L_FNAM. " Name of Function Module
              data :     WA_CPARAM TYPE SSFCTRLOP,
                            WA_OUTPUT TYPE SSFCOMPOP.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          FORMNAME           = LF_FORMNAME
        IMPORTING
          FM_NAME            = LF_FM_NAME.
      WA_CPARAM-PREVIEW = 'X'.
      WA_CPARAM-NO_DIALOG = 'X'.
      WA_CPARAM-DEVICE = 'PRINTER'.
      WA_OUTPUT-TDNOPRINT = 'X'.       "No printing from print preview
      WA_OUTPUT-TDDEST = 'LOCA'. "or 'LP01'.  "Spool: Output device
      CALL FUNCTION LF_FM_NAME
        EXPORTING
          CONTROL_PARAMETERS = WA_CPARAM
          OUTPUT_OPTIONS     = WA_OUTPUT
          USER_SETTINGS      = SPACE.

  • LookupPrintservices() gives default printer name alone...

    Hello,
    There are four printers in the network..operating system is LINUX ..when i run the program its showing only the default printer.
    If i restart the cups service ,then its showing all the options.Why is it
    so....
    So each time when i open the application ,i have to restart the cups..Is this is right way?
    Is there is any other optimistic way to show the printer options.
    Following code
    public static void main(String arg[])
         PrintService[] services = PrinterJob.lookupPrintServices();
         for(int i = 0 ;i < services.length;i++) {
         System.out.println(i+":"+services.getName());
    PrinterJob printerJob = PrinterJob.getPrinterJob();
         if (printerJob.printDialog())
         System.out.println("Printer is There... ");
    PrintService service = printerJob.getPrintService();
         System.out.println("printer Name = " +printerJob.getPrintService().getName());
    Please help me to solve this....Urgent!!!!!!!!!!!!!!!
    Message was edited by:
    rithi_megaa

    OK now it really doesn't make sense. Your code is exporting which has nothing to do with printing from the viewer...
    So, create your own Print Button and handle the file name yourself then you can call it anything you want and it gets printed from the export file name. If that third party PDF printer driver has an API available then you could populate the name there.
    Use your line of code: FileDest.DiskFileName = TextBox2.Text.ToString + " - Postage Report.pdf"
    to set the file name for that PDF Printer.
    Sorry it's really not clear what you are trying to do...
    Don

  • Why do I get the mesasge, default printer is not compatible with this version of photoshop elements

    When I print from photoshop elements 13, I get the message, default printer is not compatible with this version of photoshop elements

    Hi ,
    Please update to PSE 13.1
    13.1 has solved this problem.
    Refer to this link.
    Photoshop Elements Help | Printer errors with Photoshop Elements 13

Maybe you are looking for

  • Error when running a scenario from Command Prompt

    Hi I edited the parameter file and I am trying to run an interface that joins two tables from HR schema and loads into a table in different schema. I am able to run this in the Designer, but I receive an error message when I try to run it through com

  • Scanner no longer recognized

    Elements 10 Organizer no longer recognizes HP Photosmart Plus scanner  after attempt to install Inspiration upgrade.  Inspiration would not recognize it, so I removed it and returned to PSE 10.  What can I do?  

  • Emac resolution question

    My children have an emac, handed down. They also like to play the I Spy games. Our problem is, the game only uses what I guess is 800x600 resolution...or even maybe 640 x 480(?). Anyway, when the game runs, it is very small on the screen with black b

  • How can i get my site to load faster?

    Hello all, I am being told my site takes ages to load. Can someone have a look at it and see what you think and maybe offer me some adive! www.pcmotorsport.com Thanks, Dave.

  • Reinstall Reader X with a custom path

    I have a co-worker that hard codes a specific path of Adobe Reader to open certain PDF's that we push out to our end users.  I however used the automated installer to update the Reader version on all of our machines.  This in turn screwed up how she