Arp / Dos command format output

Hi
Im looking to run the arp command within powershell and format the output so I only see the mac addresses
Ive been trying for a while and gotten as far as         arp -A | sort-object "Physical Address"
alternatively is the a powershell equivelent of arp?  Ive tried Get-Macaddress but tht dosent work.
Generally how do I choose which column info I want from a dos command?
Anyone?
Thanks for reading
confuseis

THis works.
arp -a | %{$($_[24..41])-join ''} | select -skip 3
I can paste these mac address to nirsofts Macaddressview and that resolves all the mac addresses to the manufacturers.
Then is simply pick out all the printers.  Hurrah
Thanks
confuseis
If you're searching for printers, you can run
nmap -p 9100 -sT 192.168.1.1-254 -T2
or use page countster: http://www.laptechnologies.com/printers dot exe.
I personally prefer page countster, but I increase the timeout, otherwise some printers will be missed as they don't reply before the timeout. Run it as an admin as it require raw sockets.

Similar Messages

  • How to format with exFAT in DOS command ?

    As title.
    I would like to execute dos command "format" to format some stroage with exFAT file-format.
    How do I do ?
    For example, if I formated E:\ with NTFS, I type the command-line such as "format /FS:NTFS E".
    Thanks.

    Hello,
    I'd do:
    format e: /fs:exFAT
    Further questions on this subject should be asked in the
    Windows forum on Microsoft Community.
    As the Microsoft Community is on a different platform, we cannot move the question for you.
    Once there, click on Participate near the top of the screen, and select 'Ask a Question' or 'Start a Discussion':
    Karl
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • DOS Command Schtasks - error

    Hello,
    I am locally executing a batch file which contains the following:
    SchTasks /query /fo csv > C:\AllReports\Schedtask.txt /v /s AppServer.xyz.org
    I do get the ouptut file along with the requested info but I also get the following:
    ERROR: The task XML contains a value which is incorrectly formatted or out of range
    ERROR: Task cannot be loaded: UpsizeToSQL - Special Run - is the first line withing the output file. Subsequent lines show actual Schtasks results
    Appserver.xyz.org is a remote server I am able to access to using my network credentials. I am able to run Schtasks from the command line without issues and get a results clean of error messages. The issue appears when I execute the batch file from my local
    machine to retrieve tasks on that remote server.
    Any help to find a solution would be much appreciated.
    Thank you.

    Hello,
    I locally executing a batch file which contains the following:
    SchTasks /query /fo csv > C:\AllReports\Schedtask.txt /v /s AppServer.xyz.org
    I do get the ouptut file along with the requested info but I also get the following:
    ERROR: The task XML contains a value which is incorrectly formatted or out of range
    ERROR: Task cannot be loaded: UpsizeToSQL - Special Run - is the first line withing the output file. Subsequent lines show actual Schtasks results
    Appserver.xyz.org is a remote server I am able to access to using my network credentials. I am able to run Schtasks from the command line without issues and get a results clean of error messages. The issue appears when I execute the batch file from my local
    machine to retrieve tasks on that remote server.
    Any help to find a solution would be much appreciated.
    Thank you.
    Hi,
    Since this issue is mainly related to Dos Commands, I would recommend you refer to the following thread to get where to get supports for this issue.
    Where is the Forum for DOS Commands
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to use SQL query result in DOS commands

    Hi
    Currently i am runnig below DOS commands manually
    d:\apps\bin>TrueGridsCalc period="Aug 2010"
    Now I want to write one batch file and schedule job on windows and make value of "period" to be dynamic. So to get that value i need to fetch it from DB
    Steps which i am taking are
    1. connect DB from command line (using SQLPLUS)
    2. run query to fetch result
    3.How to use query result in "period" parameter ?
    I am good at step 1 and 2. Dnt know how to use query result in command to make it dynamic
    Thank you
    Sachin
    Edited by: sachin.mali on Oct 26, 2010 4:39 PM
    Edited by: sachin.mali on Oct 26, 2010 4:43 PM

    sachin.mali wrote:
    Hi
    Currently i am runnig below DOS commands manually
    d:\apps\bin>TrueGridsCalc period="Aug 2010"
    Now I want to write one batch file and schedule job on windows and make value of "period" to be dynamic. So to get that value i need to fetch it from DB
    Steps which i am taking are
    1. connect DB from command line (using SQLPLUS)
    2. run query to fetch result
    3.How to use query result in "period" parameter ?
    I am good at step 1 and 2. Dnt know how to use query result in command to make it dynamic
    Thank you
    Sachin
    Edited by: sachin.mali on Oct 26, 2010 4:39 PM
    Edited by: sachin.mali on Oct 26, 2010 4:43 PMYOu'll have to have sqlplus spool the output to a file, then figure out some way of parsing that file. Too bad you're stuck with Windows. With any *nix you could do the file parsing with one line of code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to run stored procedure in DOS command line????

    Hi,
    I want to run a stored procedure in DOS command line?
    (My_Stored_Procedure is the stored procedure that I want to run )
    This is what I did in DOS prompt
    C:\>sqlplus scott/tiger exec lMy_Stored_Procedure <Return>
    Obviously it is NOT working. Please send me the correct way to fix this.
    Thanks so much in advance for helping.
    Cuong

    Billy  Verreynne  wrote:
    BluShadow wrote:
    True Billy, but even Windows hasn't completely got away from using the "DOS" word...Yeah - the command line/shell environment is based on that of the old DOS command interpreter. But Microsoft does not make the mistake of call it DOS.
    In fact, with earlier versions of Windows NT, a 16bit DOS real-mode virtual machine was supported. This was very kewl.
    Running a large BBS with multiple nodes back then required a DOS machine per node, an IPX network, and a Novell file server.Novell Netwars. ;)
    Ahhhh! good old DOS... so many good programs written at that low level, outside the Windoze environment.Yeah.. cut my teeth on writing code for DOS. Still have all my old BIOS and assembler manuals for it. Wrote my own screen s/w (write to a buffer and then move it into the video buffer, instead of writing char wise to the video buffer via interrupts), mucking about with my own concurrent threading model (using very simplistic cooperative multitasking) and so on. Heck, wrote tons of s/w on DOS... :-)Yeah I've still got a copy of my old machine code programs for writing to buffers and screen memory switching for smooth animation. Run them nowadays and they run like sh!t off a shovel. And all my old coursework including writing an interpreted language and multi-window (dos based windows) editor, parser and the code to execute the language and display the output. Oooo, and so much other stuff.
    Awesome back then as you got really intimate with the o/s and hardware. This is sorely lacking today in environments like Java. And I think the reason why so much code written today is less than optimal - to put it kindly.Exactly. Started for me on the Sinclair zx81 (writing Basic), then the Sinclair Spectrum (Basic and Assembly), then Sinclair QL (yes I really had one!) and then the BBC Master 128K (where I got to writing my own rom filing system and creating my own eproms, to integrate with the word processor for additional printing features etc. as well as storing games on rom for speedy loading - and I still have it and it still works!)
    It's that level of working with the underlying memory and assembly language that gives you the understanding of how values are passed between code using the stack and registers, and how memory allocation and referencing is done etc. As you say... it's missed in a lot of todays teaching, which just seems too high level and misses the basic concepts of things such as datatypes and why they are different. I bet half the modern programmers wouldn't have a clue how to do multiplication or division of binary numbers using the carry flag.

  • Execute DOS command inside java

    I have a java program that reads each new user from an inputfile and writes that same user to an output file. The program works fine and is shown below:
    import java.io.*;
    public class FileStreamsTest {
    public static void main(String[] args) {
    try {
    File inputFile = new File("newbousrs.txt");
    File outputFile = new File("outagain.txt");
    FileInputStream fis = new FileInputStream(inputFile);
    FileOutputStream fos = new FileOutputStream(outputFile);
    int c;
    while ((c = fis.read()) != -1) {
    fos.write(c);
    fis.close();
    fos.close();
    } catch (FileNotFoundException e) {
    System.err.println("FileStreamsTest: " + e);
    } catch (IOException e) {
    System.err.println("FileStreamsTest: " + e);
    What I would like to do after each write is to execute a DOS command that looks something like this: supervsr.exe -USER username -PASS password -IMPORTUSERS importfile.txt
    The DOS command above will add each user to the system I want to as the loop goes through each user record.
    How do I execute the DOS command above inside java?

    Tried what but still having a problem...here is my code:
    import java.io.*;
    public class ReadSource {
    public static void main(String[] arguments) {
    try {
    FileReader file = new FileReader("newbousrs.txt");
                                  //FileWriter letters = new FileWriter("outagain.txt");
                                  //PrintWriter pw = new PrintWriter(new FileWriter("outagain.txt"));
    BufferedReader buff = new BufferedReader(file);
                                  Runtime rt = Runtime.getRuntime();
    boolean eof = false;
    while (!eof) {
    String line = buff.readLine();
    if (line == null)
    eof = true;
    else
    System.out.println(line);
                                                 Process proc = rt.exec("\\Blowfish\\droot\\Program Files\\Business Objects\\BusinessObjects 5.0\\supervsr.exe -USER xxxxx -PASS yyyy -IMPORTUSERS \\Blowfish\\droot\\accsp\\public\\newusers\\newbousrs.txt");
                                                 //System.out.println(line.substring(4, 10));
                                                 //System.out.println(line.substring(3,line.indexOf(',',3)));
    buff.close();
    } catch (IOException e) {
    System.out.println("Error -- " + e.toString());
    There error I get is this:
    C:\jakarta-tomcat-4.0.3\webapps\webdav\WEB-INF\classes\accsp>java ReadSource
    NU,Public,Steve Mcnealy,Steve Mcnealy,U,N,N,Y,N,N,PC,F,Y,N,N
    Error -- java.io.IOException: CreateProcess: \Blowfish\droot\Program Files\Busin
    ess Objects\BusinessObjects 5.0\supervsr.exe -USER accsp -PASS fish -IMPORTUSERS
    \Blowfish\droot\accsp\public\newusers\newbousrs.txt error=3

  • Problem while running dos command from java program

    Dear friends,
    I need to terminate a running jar file from my java program which is running in the windows os.
    For that i have an dos command to find process id of java program and kill by using tskill command.
    Command to find process id is,
    wmic /output:ProcessList.txt process where "name='java.exe'" get commandline,processid
    This command gives the ProcessList.txt file and it contains the processid. I have to read this file to find the processid.
    when i execute this command in dos prompt, it gives the processid in the ProcessList.txt file. But when i execute the same command in java program it keeps running mode only.
    Code to run this command is,
    public class KillProcess {
         public static void main(String args[]) {
              KillProcess kProcess = new KillProcess();
              kProcess.getRunningProcess();
              kProcess = new KillProcess();
              kProcess.readProcessFile();
         public void getRunningProcess() {
              String cmd = "wmic /output:ProcessList.txt process where \"name='java.exe'\" get commandline,processid";
              try {
                   Runtime run = Runtime.getRuntime();
                   Process process = run.exec(cmd);
                   int i = process.waitFor();
                   String s = null;
                   if(i==0) {
                        BufferedReader stdInput = new BufferedReader(new
                               InputStreamReader(process.getInputStream()));
                        while ((s = stdInput.readLine()) != null) {
                         System.out.println("--> "+s);
                   } else {
                        BufferedReader stdError = new BufferedReader(new
                               InputStreamReader(process.getErrorStream()));
                        while ((s = stdError.readLine()) != null) {
                         System.out.println("====> "+ s);
                   System.out.println("Running process End....");
              } catch(Exception e) {
                   e.printStackTrace();
         public String readProcessFile() {
              System.out.println("Read Process File...");
              File file = null;
              FileInputStream fis = null;
              BufferedReader br = null;
              String pixieLoc = "";
              try {
                   file = new File("ProcessList.txt");
                   if (file.exists() && file.length() > 0) {
                        fis = new FileInputStream(file);
                        br = new BufferedReader(new InputStreamReader(fis, "UTF-16"));
                        String line;
                        while((line = br.readLine()) != null)  {
                             System.out.println(line);
                   } else {
                        System.out.println("No such file");
              } catch (Exception e) {
                   e.printStackTrace();
              return pixieLoc;
    }     when i remove the process.waitFor(), then while reading the ProcessList.txt file, it says "No such file".
    if i give process.waitFor(), then it's in running mode and program is not completed.
    Colud anyone please tell me how to handle this situation?
    or Is there anyother way to kill the one running process in windows from java program?
    Thanks in advance,
    Sathish

    Hi masijade,
    The modified code is,
    class StreamGobbler extends Thread
        InputStream is;
        String type;
        StreamGobbler(InputStream is, String type)
            this.is = is;
            this.type = type;
        public void run()
            try
                InputStreamReader isr = new InputStreamReader(is, "UTF-16");
                BufferedReader br = new BufferedReader(isr);
                String line=null;
                while ( (line = br.readLine()) != null)
                    System.out.println(type + ">" + line);
                } catch (IOException ioe)
                    ioe.printStackTrace(); 
    public class GoodWindowsExec
        public static void main(String args[])
            try
                String osName = System.getProperty("os.name" );
                String[] cmd = new String[3];
                 if( osName.equals( "Windows 95" ) )
                    cmd[0] = "command.com" ;
                    cmd[1] = "/C" ;
                    cmd[2] = "wmic process where \"name='java.exe'\" get commandline,processid";
                } else {
                    cmd[0] = "cmd.exe" ;
                    cmd[1] = "/C" ;
                    cmd[2] = "wmic process where \"name='java.exe'\" get commandline,processid";
                Runtime rt = Runtime.getRuntime();
                System.out.println("Execing " + cmd[0] + " " + cmd[1]
                                   + " " + cmd[2]);
                Process proc = rt.exec(cmd);
                System.out.println("Executing.......");
                // any error message?
                StreamGobbler errorGobbler = new
                    StreamGobbler(proc.getErrorStream(), "ERROR");           
                          // any output?
              StreamGobbler outputGobbler = new
                    StreamGobbler(proc.getInputStream(), "OUTPUT");
                          // kick them off
                errorGobbler.start();
                outputGobbler.start();
                // any error???
                int exitVal = proc.waitFor();
                System.out.println("ExitValue: " + exitVal);       
            } catch (Throwable t)
                t.printStackTrace();
    }when i execute the above code, i got output as,
    Execing cmd.exe /C wmic process where "name='java.exe'" get commandline,processid
    and keeps in running mode only.
    If i execute the same command in dos prompt,
    CommandLine
    ProcessId
    java -classpath ./../lib/StartApp.jar;./../lib; com.abc.middle.startapp.StartAPP  2468
    If i modify the command as,
    cmd.exe /C wmic process where "name='java.exe'" get commandline,processid  > 123.txt
    and keeps in running mode only.
    If i open the file when program in running mode, no contents in that file.
    If i terminte the program and if i open the file, then i find the processid in that file.
    Can you help me to solve this issue?

  • I have tried to format my HDD from MS-DOS fat to MAC OS Extended (jurnaled) but after formating turns to the same MS-DOS FAT format why?

    I have tried to format my HDD from MS-DOS fat to MAC OS Extended via disk utility but after formating turns to the same MS-DOS FAT format why?my current OS is 10.5

    You will need to perform an Internet Recovery or be able to boot the computer using a Snow Leopard 10.6.3 or later DVD. For the former:
    Restart the computer and at the chime press and hold down the COMMAND-OPTION-R keys until you see a globe appear in the gray startup screen. This may take a little while so be patient. You need to have an internet connection for this to work - preferably using Ethernet.
    After a fairly long period of time - 15 minutes or more - the recovery screen will appear. Select Disk Utility from the main menu, and click on the Continue button.
    1. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
    2. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed.
    3. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
    4. Set the format type to Mac OS Extended (Journaled.) Click on the Security button, check the button for Zero Data and click on OK to return to the Erase window.
    5. Click on the Erase button. The format process can take up to several hours depending upon the drive size.
    6. After formatting is done quit DU and return to the main menu. Select Install OS X from the main menu and click on the Continue button. Follow the onscreen instructions to install OS X onto the internal drive.

  • Help! invoke dos command!!

    i want to implement a notepad in java language, it can invoke a dos command(ping.exe) to some IP addresses stored in a text file, and store the ping results into a text file, how can i invoke a dos command and store the execute results into a text file???

    If you want to execute an external ping command and collect the result, it can be done by using the Runtime class. Runtime's exec method returns a Process supplying you with an input stream containing the ping result. You must make sure to read the output on the go (to avoid blocking the entire process).
    Here's an outline:
    import java.io.*;
    public class Ping {
        public static void main(String args[]) {
            try {           
                String[] cmd = { "ping.exe", "time.nist.gov" }; // Command and argument
                Process process = Runtime.getRuntime().exec(cmd); // Execute command
                // Read output - in separate thread
                streamReader sr = new streamReader( process.getInputStream() );
                sr.start();
                process.waitFor(); // Wait until process has terminated
            } catch (Exception e) {
                System.err.println(e);
    class streamReader extends Thread { // Read input stream (new thread)
        InputStream is;
        streamReader(InputStream is) {
            this.is = is;
        public void run() {
            try {
                BufferedReader br = new BufferedReader(new InputStreamReader(is));
                String rline;
                while ( (rline = br.readLine()) != null)
                    System.out.println(rline);   
                } catch (IOException e) {
                    System.err.println(e); 

  • Results of Query Wrap Within DOS Command Window.

    Greetings,
    I am using SQL*PLUS within the DOS command window.
    The results of my query is wrapping down the page, instead of using the entire width of the window.
    I have set the windows mode command, before going into SQL*PLUS:
    MODE CON: COLS=100 LINES=40
    So, I was hoping to have Oracle use all 100 columns, when displaying the answer set.
    Regards,
    Dave

    Hi Dave,
    Size of lines, columns and pages are controlled by SQL*Plus system variables
    For width of lines
    SET LINES[IZE] which defaults to 80
    For number of lines per "page"
    SET PAGES[IZE] which defaults to 14
    To control formatting, including width of indicidual columns you have COL[UMN], e.g:
    COLUMN your_column FORMAT a20
    For more settings:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e16604/ch_twelve040.htm
    If you want certain settings each time you open SQL*Plus, you can add those to your glogin.sql
    Regards
    Peter

  • Runnig DOS commands from the java code?

    Hi reader,
    how can I execute DOS commands (I am on an Windows XP Machine) from my java code and also capture the output?
    I think the
    runtime.exec(command)
    only executes win32 processes.
    Please suggest
    TIA
    Ayusman

    Again, this link should tell you most of what you need to know:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    You're not limited to the Win32 platform unless you're using specific DOS commands. Perhaps if you're just after file system information then some of the classes in the java.io package can help.
    If it's not enough, perhaps a resource bundle or something similar can provide you with the names of the external programs you need to run, i.e. "dir" for win and "ls" for *nix.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem in Execution of DOS Commands with JAVA.

    I am trying to execute DOS Commands and FTP commands using Java Programming Language and Trying to get the output for further processing.Actually I want the exact output what DOS and FTP give after execution of a their corresponding commands.

    Process p = new Process("dir");
    InputStream is = p.getInputStream();

  • Issue DOS commands?

    How do I issue DOS commands from within a Java program and retrieve the DOS output as input to the program?

    See this JavaWord article for lots of detail and some
    traps and pitfalls...
    ChuckOh, and I suppose you wanted the link too... ;-<
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Is it possible to call ms-dos command in abap program?

    Hi,
    is it possible to call ms-dos command in abap program?
    Thanks.

    Hi Cemil,
    You probably have your answer here:
    [Re: DOS/Windows command in app server;
    You create your external command with SM69 (you can test it with SM49).
    Then you call this command with function module "SXPG_COMMAND_EXECUTE".
    (See function group SXPT for all the calls to external commands).
    Regards,
    Thomas

  • How to run multiple DOS commands from a single Webutil Client_Host session?

    Hello all,
    I have a requirement where I need to create an interface with SVN from Forms for basic checkin-checkout of files.
    So, I've been trying to use webutil client_host to open a command line session and issue svn commands.
    For svn, sometimes I need to give multiple commands like change to a particular directory and then run an svn command.
    But client_host takes in only one command at a time and I'm unable to issue a series of DOS commands to perform
    a particular task.
    Is there a way to do this?
    Pls suggest.
    Regards,
    Sam

    First your original question... You can put more than one DOS command on a single line, simply separate each command with an ampersand (&). For example:
    mkdir c:\abc & cd abc & dir*
    Regarding your concerns about performance, well that would depend on exactly what you mean. Using CLIENT_HOST (or HOST on the server) simply opens a shell (DOS in this case) then passes your command to it. The performance of performing this action really isn't measurable. Basically you are just pressing a button and you should get a near immediate action. As for the performance of executing each command, that has nothing to do with Forms. Once the command is passed to the shell, the rest is a function of the shell and whatever command you passed.
    Having said that, if you were to write something sloppy like a loop (in pl/sql) which called CLIENT_HOST lots of times repeatedly, then yes there would be a performance problem because the pushing of the button will cause an exchange to and from the server and each cycle in the loop will do the same.
    So the answer to how performance is impacted will depend on what exactly you need to accomplish. If it is a single call to CLIENT_HOST, this should be fine.

Maybe you are looking for