Check resolution and write in CSV

I need a script which check the resolution of an image and if the resolution is below 300, it needs to create an CSV/Text file into desktop with the string "Resolution is below 300". Is that possible to do it using script? Kindly advise.

Checking the resolution should not be difficult.
var theRes = app.activeDocument.resolution;
if (theRes < 300) {/*insert code here*/};
This could be used to write a txt file, but there are probably other examples both on this Forum and on http://ps-scripts.com/bb/
////// function to write a preference-file storing a text //////
function writePref (theText, thePath) {
  try {
    var thePrefFile = new File(thePath);
    thePrefFile.open("w");
    for (var m = 0; m < theText.length; m ++) {
      thePrefFile.write(theText[m])
    thePrefFile.close()
  catch (e) {};

Similar Messages

  • Read and write a .CSV file contains cirillic characters issue

    Hi guys,
    I am a developer of a web application project which uses Oracle Fusion Middleware technologies. We use JDeveloper 11.1.1.4.0 as development IDE.
    I have a requirement to get a .csv file from WLS to application running machine. I used a downloadActinLinsener in front end .jspx in order to do that.
    I use OpenCSV library to read and write .csv files.
    Here is my code for read and write the .csv file,
    public void dwdFile(FacesContext facesContext, OutputStream out) {
    System.out.println("started");
    String [] nextLine;
    try {
    FileInputStream fstream1 = new FileInputStream("Downloads/filetoberead.CSV");
    DataInputStream in = new DataInputStream(fstream1);
    BufferedReader br = new BufferedReader(new InputStreamReader(in,"UTF-8"));
    CSVReader reader = new CSVReader(br,'\n');
    //CSVReader reader = new CSVReader(new FileReader("Downloads/ACTIVITY_LOG_22-JAN-13.csv"),'\n');
    List<String> list=new ArrayList();
    while ((nextLine = reader.readNext()) != null) {
    if(nextLine !=null){
    for(String s:nextLine){
    list.add(s);
    System.out.println("list size ; "+list.size());
    OutputStreamWriter w = new OutputStreamWriter(out, "UTF-8");
    CSVWriter writer = new CSVWriter(w, ',','\u0000');
    for(int i=0;i<list.size();i++){
    System.out.println("list items"+list.get(i));
    String[] entries = list.get(i).split(",");
    writer.writeNext(entries);
    //System.out.println("list items : "+list.get(i));
    writer.close();
    } catch (IOException e) {
    e.printStackTrace();
    say the filetoberead.CSV contains following data,
    0,22012013,E,E,ASG,,O-0000,O,0000,100
    1,111211,LI,0,TABO,B,M002500003593,,,К /БЭ60072715/,КАРТЕНБАЙ
    2,07,Balance Free,3
    1,383708,LI,0,BDSC,B,НЭ63041374,,,Т /НЭ63041374/,ОТГОНБААТАР
    2,07,Balance Free,161
    It reads and writes the numbers and english characters correct. All cirillic characters it prints "?" as follows,
    0,22012013,E,E,ASG,,O-0000,O,0000,100
    1,111211,LI,0,TABO,B,M002500003593,,,? /??60072715/,?????????
    2,07,Balance Free,3
    1,383708,LI,0,BDSC,B,??63041374,,,? /??63041374/,???????????
    2,07,Balance Free,161
    can somone please help me to resolve this problem?
    Regards !
    Sameera

    Are you sure that the input file (e.g. "Downloads/filetoberead.CSV") is in UTF-8 character set? You can also check it using some text editor having a view in hex mode. If each Cyrillic character in your input file occupies a single byte (instead of two), then the file is not in UTF-8. Most probably it is in Cyrillic for Windows (CP1251).
    If this is the case, you should modify the line
    BufferedReader br = new BufferedReader(new InputStreamReader(in,"UTF-8"));toBufferedReader br = new BufferedReader(new InputStreamReader(in,"windows-1251"));Dimitar

  • How can I read, millions of records and write as *.csv file

    I have to return some set of columns values(based on current date) from the database (could be million of record also) The dbms_output can accomodate only 20000 records. (I am retrieving thru a procedure using cursor).
    I should write these values to a file with extn .csv (comma separated file) I thought of using a utl_file. But I heard there is some restriction on the number of records even in utl_file.
    If so, what is the restriction. Is there any other way I can achive it? (BLOB or CLOB ??).
    Please help me in solving this problem.
    I have to write to .csv file, the values from the cursor I have concatinated with "," and now its returning the value to the screen (using dbms_output, temporarily) I have to redirect the output to .csv
    and the .csv should be in some physical directory and I have to upload(ftp) the file from the directory to the website.
    Please help me out.

    Jimmy,
    Make sure that utl_file is properly installed, make sure that the utl_file_dir parameter is set in the init.ora file and that the database has been re-started so that it will take effect, make sure that you have sufficient privileges granted directly, not through roles, including privileges to the file and directory that you are trying to write to, add the exception block below to your procedure to narrow down the source of the exception, then test again. If you still get an error, please post a cut and paste of the exact code that you run and any messages that you received.
    exception
        when utl_file.invalid_path then
            raise_application_error(-20001,
           'INVALID_PATH: File location or filename was invalid.');
        when utl_file.invalid_mode then
            raise_application_error(-20002,
          'INVALID_MODE: The open_mode parameter in FOPEN was
           invalid.');
        when utl_file.invalid_filehandle then
            raise_application_error(-20002,
            'INVALID_FILEHANDLE: The file handle was invalid.');
        when utl_file.invalid_operation then
            raise_application_error(-20003,
           'INVALID_OPERATION: The file could not be opened or
            operated on as requested.');
        when utl_file.read_error then
            raise_application_error(-20004,
           'READ_ERROR: An operating system error occurred during
            the read operation.');
        when utl_file.write_error then
            raise_application_error(-20005,
                'WRITE_ERROR: An operating system error occurred
                 during the write operation.');
        when utl_file.internal_error then
            raise_application_error(-20006,
                'INTERNAL_ERROR: An unspecified error in PL/SQL.');

  • Read and write into csv file using procedure

    I would like to read a particular column value from csv file(which will have many columns) using procedure and for that value I have to retrieve some more values from database table and have to append into same csv file.
    can someone help me?
    Thanks
    Edited by: 1002478 on Apr 25, 2013 5:52 AM
    Edited by: 1002478 on Apr 25, 2013 5:55 AM

    1002478 wrote:
    thanks for your reply.
    Using UTL_FILE i'm able to read csv file. I'm stuck up in appending some more columns to same csvYou'll struggle to append data to an existing CSV.
    You'd be better to read the data from one CSV, and create another CSV using that data, and the extra data you want, and then when finished, delete the original file and rename the new file to the old filename.
    You should be able to do that using External Tables to read the source file (easier than using UTL_FILE) and UTL_FILE to write the new file.

  • Check resolution and clarity for sizing?

    Hello - I have an issue where I print an image to a larger size, say 16x24 and the image in grainy.  How do I check in LR3 what the image will look like at the enlarges size?  I know there is a way!

    You can't use your monitor to preview the printed output graininess of a photo because the Points Per Inch of a monitor is much lower then that of a printed output; Instead a bit of math will give you an indication of the graininess of a photo.
    Divide the pixel width and height of the photo by the corresponding width and height of the intended printed output; take the smallest of these results and this will give you the Points Per Inch or PPI of the photo. For example, let's suppose that you have a 3000 pixel x 4000 pixel photo (approximately 12 Mega Pixel) and you want to output at 16 inches x 24 inches, then you would divide 3000/16=187.5 and 4000/24=166.66 so you maximum resolution given these numbers would be 166 PPI.
    Typically good quality is achieved between 240 and 300 PPI but this also depends on the intended viewing distance; the further the viewing distance the lower the tolerance on PPI and the closer the viewing distance the higher the PPI should be; magazines are printed at much more then 300PPI while posters on a building may be printed at less then 100PPI.
    You can tell Lightroom to enlarge a JPG output to a certain size while mainaining a specified PPI at export time or you can specify the PPI of your given print layout in the print module. If this doesn't give you satisfactory results, you may need software such as "Genuine Fractals 6" to enlarge your photo with less graininess.
    Hope this helps.

  • How to get sql query data and write into csv file?

    I am writing to seek help, in how can I create bat. script which can execute the following logic:
    connection to the database
    run sql query
    create CSV file
    output query data, into CSV file
    save the CSV file
    osql
    -S 84.18.111.111
    -U adw
    -P rem
    -i "c:\query.sql"
    send ""
    sed -e 's/,\s\+/,/g' MCI_04Dec2014.csv > localNoSpaces.csv
    -o "c:\MCI_04Dec2014.csv"
    This what i have so far, and I am little struggling with the logic after creating CSV file. I am unable to get the above script to work, please advice further, where I may be going wrong. 
    Can you create if statement logic within window's script, to check for null parameters or data feeds?
    Any hints would be most appreciated. 

    Thank you for your reply. 
    Apology for posting the code irrelevant to the forum, as I am still novice scripting user.  
    My goal is to create window's script which can compute the above logic and send the final output file (csv), to FTP folder. 
    Can this logic be implemented via bat. script, if so, is there a example or tutorial i could follow, in order to achieve my task. 
    Any help would be much appreciated. 

  • Can you improve the speed of my CSV Reader and Writer?

    hi all, i'm trying to develop a CSV Writer and Reader. i have done a good work to implement the special character and quoting it, it's also support multi line value but it's incredibly slow.
    can someone help to make it faster?
    here it's how to use the writer
    char *stringhe_sorgenti[10] = {0};
    out = OpenFile(nfile, VAL_WRITE_ONLY, VAL_TRUNCATE, VAL_ASCII);
    for(i = 0; i < sizeof(stringhe_sorgenti)/sizeof(char*); i++){
    stringhe_sorgenti[i] = (char*)calloc(200, sizeof(char));
    sprintf(stringhe_sorgenti[0], "example1");
    sprintf(stringhe_sorgenti[1], "example2");
    scrivi_riga_csv(out, stringhe_sorgenti, sizeof(stringhe_sorgenti)/sizeof(char*), formato);
    for(i = 0; i < sizeof(stringhe_sorgenti)/sizeof(char*); i++){
    free(stringhe_sorgenti[i]);
    CloseFile(out);
    here is the writer 
    void scrivi_riga_csv(int file_handle, char *stringa_sorgente[], int numero_stringhe, int formato)
    char delimitatore[2][2] = {{',', '\0'}, {';', '\0'}};
    char stringa_destinazione[1024] = {0};
    int index_destinazione = {0};
    int index_start = {0};
    int index_fine = {0};
    int errore = {0};
    int i = {0};
    //int k = {0};
    size_t lunghezza_stringa = {0};
    for(i = 0; i < numero_stringhe; i++){
    if(i != 0){
    stringa_destinazione[index_destinazione++] = delimitatore[formato][0];
    index_start = 0;
    lunghezza_stringa = strlen(stringa_sorgente[i]);
    // se la stringa sorgente
    if( (FindPattern(stringa_sorgente[i], 0, lunghezza_stringa, delimitatore[formato], 0, 0) != -1) // contiene delimitatore
    || (FindPattern(stringa_sorgente[i], 0, lunghezza_stringa, "\"", 0, 0) != -1) // contiene parentesi
    || (FindPattern(stringa_sorgente[i], 0, lunghezza_stringa, "\n", 0, 0) != -1) // contiene a capo
    // apro parentesi all'inizio
    stringa_destinazione[index_destinazione++] = '"';
    // metodo find pattern, piu' complesso ma piu' performante
    do{ index_fine = FindPattern(stringa_sorgente[i], index_start, lunghezza_stringa - index_start, "\"", 0, 0);
    if(index_fine != -1){
    index_fine++;
    // copio dall'inizio fino alle virgolette
    CopyString (stringa_destinazione, index_destinazione, stringa_sorgente[i], index_start, index_fine - index_start);
    index_destinazione += index_fine - index_start;
    // ne aggiungo una dopo
    stringa_destinazione[index_destinazione++] = '"';
    // aggiorno la posizione di start e riparto con il while
    index_start = index_fine;
    }while(index_fine != -1);
    CopyString (stringa_destinazione, index_destinazione, stringa_sorgente[i], index_start, lunghezza_stringa - index_start);
    index_destinazione += strlen(stringa_sorgente[i]) - index_start;
    // alla fine della riga chiudo la parentesi
    stringa_destinazione[index_destinazione++] = '"';
    else{
    // altrimenti la copio semplicemente e shifto l'indice della stringa di destinazione
    CopyString (stringa_destinazione, index_destinazione, stringa_sorgente[i], 0, lunghezza_stringa);
    index_destinazione += strlen(stringa_sorgente[i]);
    memset(stringa_sorgente[i], 0, strlen(stringa_sorgente[i]));
    errore = WriteLine (file_handle, stringa_destinazione, strlen(stringa_destinazione));
    if(errore == -1){
    errore = GetFmtIOError();
    MessagePopup("WriteLine -> WriteLine", GetFmtIOErrorString(errore));
    return;
     here how to read the file
    char *stringhe_sorgenti[10] = {0};
    for(i = 0; i < sizeof(stringhe_sorgenti)/sizeof(char*); i++){
    stringhe_sorgenti[i] = (char*)calloc(200, sizeof(char));
    out = OpenFile(nomearchivio, VAL_READ_ONLY, VAL_OPEN_AS_IS, VAL_BINARY);
    leggi_riga_csv(out, stringhe_sorgenti, sizeof(stringhe_sorgenti)/sizeof(char*), formato);
    strcpy(intestazione.data, stringhe_sorgenti[1]);
    for(i = 0; i < sizeof(stringhe_sorgenti)/sizeof(char*); i++){
    free(stringhe_sorgenti[i]);
    CloseFile(out);
     and here the reader
    void leggi_riga_csv(int file_handle, char *stringa_destinazione[], int numero_stringhe, int formato)
    char delimitatore[2][2] = {{',', '\0'},
    {';', '\0'}};
    char stringa_sorgente[1024] = {0};
    int stringa_in_corso = {0};
    int index_inizio_valore = {0};
    int index_doublequote = {0};
    int offset_stringa_destinazione = {0};
    size_t lunghezza_stringa = {0};
    int inquote = {0};
    int errore = {0};
    int i = {0};
    for(i = 0; i < numero_stringhe; i++){
    lunghezza_stringa = strlen(stringa_destinazione[i]);
    memset(stringa_destinazione[i], 0, lunghezza_stringa);
    do{ memset(&stringa_sorgente, 0, sizeof(stringa_sorgente));
    errore = ReadLine(file_handle, stringa_sorgente, sizeof(stringa_sorgente) - 1);
    // If ReadLine reads no bytes because it has already reached the end of the file, it returns –2.
    // If an I/O error occurs, possibly because of a bad file handle, ReadLine returns –1.
    // You can use GetFmtIOError to get more information about the type of error that occurred.
    // A value of 0 indicates that ReadLine read an empty line.
    if(errore == -1){
    errore = GetFmtIOError();
    MessagePopup("leggi_riga_csv -> ReadLine", GetFmtIOErrorString(errore));
    return;
    else if(errore == -2){
    errore = GetFmtIOError();
    MessagePopup("leggi_riga_csv -> ReadLine", "already reached the end of the file");
    return;
    else{
    lunghezza_stringa = errore;
    index_inizio_valore = 0;
    // metodo find pattern, piu' complesso ma piu' performante
    for(i = 0; i <= lunghezza_stringa; i++){
    // se come primo carattere ho una " allora e' una stringa speciale
    if(inquote == 0){
    if(stringa_sorgente[i] == '\"'){
    inquote = 1;
    index_inizio_valore = ++i;
    else{
    // altrimenti cerco il delimitatore senza il ciclo for
    i = FindPattern(stringa_sorgente, i, lunghezza_stringa - index_inizio_valore, delimitatore[formato], 0, 0);
    if(i == -1){
    // se non lo trovo ho finito la riga
    i = lunghezza_stringa;
    if(stringa_sorgente[i - 1] == '\r'){
    i--;
    if(stringa_in_corso < numero_stringhe){
    CopyString (stringa_destinazione[stringa_in_corso], 0, stringa_sorgente, index_inizio_valore, i - index_inizio_valore);
    offset_stringa_destinazione = 0;
    stringa_in_corso++;
    if(stringa_sorgente[i] == '\r'){
    i++;
    index_inizio_valore = i + 1;
    if(inquote == 1){
    // se sono nelle parentesi cerco le virgolette
    i = 1 + FindPattern(stringa_sorgente, i, lunghezza_stringa - index_inizio_valore, "\"", 0, 0);
    if(i == 0){
    if(stringa_sorgente[lunghezza_stringa - 1] == '\r'){
    lunghezza_stringa--;
    // se non le trovo ho finito la riga, esco dal ciclo for
    break;
    // se incontro una doppia parentesi salto avanti
    else if(stringa_sorgente[i] == '\"'){
    continue;
    // !!!! fondamentale non cambiare l'ordine di questi else if !!!!!
    // se incontro una parentesi seguita dal delimitatore
    // o se incontro una parentesi seguita dal terminatore
    // \r = CR = 0x0D = 13
    // \n = LF = 0x0A = 10
    // a capo = CR + LF
    else if( (stringa_sorgente[i] == delimitatore[formato][0])
    || (stringa_sorgente[i] == '\r')
    || (stringa_sorgente[i] == '\0')
    // salvo il valore
    inquote = 0;
    if(stringa_in_corso < numero_stringhe){
    CopyString (stringa_destinazione[stringa_in_corso], offset_stringa_destinazione, stringa_sorgente, index_inizio_valore, i - 1 - index_inizio_valore);
    offset_stringa_destinazione = 0;
    stringa_in_corso++;
    if(stringa_sorgente[i] == '\r'){
    i++;
    index_inizio_valore = i;
    // se sono andato a capo scrivo fino a dove sono e poi procedo con la nuova riga
    if(inquote){
    if(stringa_in_corso < numero_stringhe){
    CopyString (stringa_destinazione[stringa_in_corso], offset_stringa_destinazione, stringa_sorgente, index_inizio_valore, lunghezza_stringa - index_inizio_valore);
    strcat(stringa_destinazione[stringa_in_corso], "\n");
    offset_stringa_destinazione += lunghezza_stringa - index_inizio_valore;
    offset_stringa_destinazione++;
    }while(inquote == 1);
    // elimino le doppie parentesi
    for(i = 0; i < numero_stringhe; i++){
    index_doublequote = 0;
    do{ lunghezza_stringa = strlen(stringa_destinazione[i]);
    index_doublequote = FindPattern(stringa_destinazione[i], index_doublequote, lunghezza_stringa - index_doublequote, "\"\"", 0, 0); // contiene doppia parentesi
    if(index_doublequote != -1){
    index_doublequote++;
    memmove (stringa_destinazione[i] + index_doublequote, stringa_destinazione[i] + index_doublequote + 1, lunghezza_stringa - index_doublequote);
    }while(index_doublequote != -1);
    return;

    the format is CSV, i try to explain better what i'm doing.
    our client asked to save acquisition data with header description in an excel readable format, i've decided to use .CSV and not .TDM because it's a simple txt file and we never used .TMD but i will propose to use it.
    after some research on the internet i've found nothing to handle .CSV in CVI except from this csv_parse but i've found it difficult to be maintained so i've write it by my own hand.
    i've written two example of how to use my function to read or write and i've copyed my function used to read and write.
    in the write function i check with FindPattern if the string to be write contain some special character, if i find this i have to quote the string to respect the standard RFC4180 and if i find a quote i have to double it. aftere i've done this check i write the line in the file.
    in the read function, that is more complicated, i:
    check if the first character is a quote.
    if it's not i copy the string until the delimitier or until the end of the line.
    if it is i have a string with special character inside so:
    i find the first quote in the string. when i've found i check if it's follwed by another quote. this means that in the starting message i was writing a single quote.
    if it's not followed by another quote but it's followed by a delimiter or a carriage return i've finished the special line.
    if i don't find it it means that the special quote have a carriage return inside and i have to check the next line. before checking the next line i save this in my string.
    after this loop i check in every string if i have a double quote and i delete one.
    the main problem is in the speed of this, i'm acquiring data at 1000 S/s with 8 active channel for 60 second so i have 480000 data to be stored, divided in 60.000 row and 8 column. to read a file like that my pc stay "locked" for 15 second or more.
    i've tried to use the arraytofile function and it's extremly fast and i can also put header because the function can start from the last position in the file but the filetoarray function start from the beginning and i cannot read the header correctly. also if i'm using the european CSV with semicolon as delimiter with arraytofile i cannot select the semicolon but only the coma

  • Importing illustrator pdfs into photoshop sometimes won't allow me to open and check resolution?

    Here's the scenario:
    Customer sends me an illustrator file with an embedded image. I need to check the resolution of the image to see see if it is high resolution enough for print. I delete all art but the image in illustrator and then save that file as a pdf with the illustrator default.
    I drag that pdf file into photoshop where I get the "Import PDF" dialog box. I know if I select the "Pages" button, then the resolution and color that appears in the dialog box are not the true specifications for the image. I have to select the "Images" button and open the file from there HOWEVER sometimes this option is not available and the "open" button is grayed out. I have yet to figure out why this happens on some of the pdf files I've saved from Illustrator.
    This is the only way I have found to check resolutions on embedded files where I do not have the actual linked graphic. Does anyone have any ideas? Thanks for any help!

    Just check the resolution in Illustrator instead of exporting a PDF to check in Photoshop.
    If the image only is selected then the resolution is displayed in Control bar.
    It may be in a nest of groups so either double-click repeatedly on the image until you've drilled down to it or select it in the Layers panel where the disclosure triangles will give access to it.

  • How do I change the color of font in a fillable form in Adobe Reader? How can I check if the writer of the document has given permission to edit color and not just add text?

    How do I change the color of font in a fillable form in Adobe Reader? How can I check if the writer of the document has given permission to edit color and not just add text? Please help! I'm technologically challenged.

    Most forms (99% or more) are created for simple text input, where you cannot change anything.
    The creator of the form could allow Rich Text input (which allows you to change font, text size, color, etc.), but frankly I have never seen such a form, and I wouldn't know how they look.  But I'm sure they would show some kind of controls to alter the text appearance.

  • When connect appletv to tv it is asking to check the resolution and change the resolution

    First time when I am connecting appletv to SamsungTV it is asking to check the resolution and change the resolution.

    Keynote can not burn DVD discs, nor can it compile a video DVD project
    If you have iDVD installed on your Mac, You can export the Keynote presentation to iDVD to create a video DVD:  
    from within Keynote:     Share > Send to > iDVD

  • CS3 Installation "check disc space and write privileges" message

    I recently purchased a new desktop.  I  deactivated CS3 from my old computer (Windows Vista OS) and downloaded CS3 to the new(Windows 7 OS), After it shows 100% extraction, I get a "A problem occured while extracting some files. Check available space on your computer and write privileges for destination folder."  Not sure what to do from here and Adobe does not offer any phone support for my archaic version of PS. 
    I tried out copying the downloaded ADBEPSHPCS3_WWE file to C:\ as suggested in a previous post, however to no avail.
    Many thanks in advance to whomever might be able to offer assistance.

    Thanks again for the replys....
    Like I said, my desktop is new--I'm not a techno geek just yet, but it's an ASUS, Intel dual core, I've got 340GB of 372GB available on  C:\ and 550GB of 550GB on D:\ ...Would space be an issue with these stats??  The product is downloaded, and when I go to start the instal, it looks like it's doing well at extracting the files and indeed I can access the setup.exe file, but when I try to open it, I get the Windows "Do you want to allow this program to make changes to this computer?"  When I click yes, that window goes away, but nothing else seems to happen??

  • I have been trying to download photos. It keeps saying can't create file, please check permissions on destination folder. Ihave made sure I have set the permissions on read and write. What am I doing wrong?

    I have been trying to download photos too my MAC. It keeps saying can't create file, please check permissions on destination folder. Ihave made sure I have set the permissions on read and write. What am I doing wrong?

    Lanakivee
    Try this it worked for me Pat Willener gave it to me off the site :
    I have not read all you wrote, so I may have missed some points. As I understand it, you installed FP 10 on IE7, but it won't play any Flash content?
    Try this
    download the FP uninstaller from http://www.adobe.com/go/tn_14157
    close all browser windows, then run the uninstaller
    download the offline ActivX installer for Internet Explorer from http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_ax.exe
    close all browser windows, then run the installer

  • Check image resolution and color

    Please let me know whether it is possible to get the image resolution and color used in a eps file.
    regards,
    Sashi

    You can specify the resolution for exporting, for document etc but resolution of the raster objects can not be retrieved.
    Color space of the raster object can be retrieved using the rasterItems : colorants or imageColorSpace properties  

  • Alert: Logical disk transfer (reads and writes) latency is too high Resolution state

    Hi 
    We are getting following errors for my 2 virtual servers. We are getting this alert continuously. My setup Windows 2008 R2 SP1 2 node Hyper V cluster. Which is hosted 7 guest OS out of am facing this problem with to guest os. Once this alert started
    my backup running slow.  
    Alert: Logical disk transfer (reads and writes) latency  is too high
    Source: E:
    Path: Servername.domain.com
    Last modified by: System
    Last modified time: 4/23/2013 4:15:47 PM Alert description: The threshold for the Logical Disk\Avg. Disk sec/Transfer performance counter has been exceeded.
    Alert view link: "http://server/OperationsManager?DisplayMode=Pivot&AlertID=%7bca891ba3-e9f2-421f-9994-7b4d6e867b33%7d"
    Notification subscription ID generating this message: {F71E01AF-0BE6-8377-7BE5-5CB6F5C037A1}
    Reagrds
    Mahesh

    Hi,
    Please see if following helps
    Disk transfer (reads and writes) latency is too high
    The
    threshold for the Logical Disk\Avg. Disk sec/Transfer performance counter has been exceeded
    If they are of no help, try asking this question in Operations Manager - General forum since alerts are generated by SCOM.
    Regards, Santosh
    I do not represent the organisation I work for, all the opinions expressed here are my own.
    This posting is provided AS IS with no warranties or guarantees and confers no rights.

  • Harvesting asset info and output to CSV

    I need a script modified that will run on all servers in a work group in order to gather asset data on the appliances running Windows Server 2000 embedded edition. There are no domain services and these systems and this network technology is not an option
    in our environment due to proprietary security, networking and infrastructure restrictions. I have found a script that works but i need it modified to output to a csv as it wont output and .xls .xlsx properly. The script will be run on the only computer on
    the network that can access these devices. Any help on this would be awesome.
    ' Get Windows Server Information
    ' Written By Kely Mulcahey, E.C.S. LLC.
    ' Created: March 1, 2006
    ' Version: 3.0, Revised 5/30/2014
    On Error Resume Next
    Dim PUBOSVer ' Global OS Version
    ' Open File For Writing
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    Const ForReading = 1
    ' Get Server List
    strServerFilename = "servers.txt"
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    If objFSO.FileExists(strServerFilename) Then
    ' Open Servers File
    Set objServers = objFSO.OpenTextFile(strServerFilename, ForReading)
    Else
    ' Server File is missing: Exit
    intMsg = MsgBox("File: " & Chr(34) & UCASE(strServerFilename) & Chr(34) & _
    " is either " & _
    "Missing or Damaged!" & vbcrlf & _
    vbcrlf & _
    "This Script will now Exit.", vbCritical, "Server File Error")
    WScript.Quit(0)
    End If
    Do Until objServers.AtEndOfStream
    strNewServer = Trim(objServers.ReadLine)
    strServerList = strServerList & strNewServer & vbcrlf
    intServerCnt = intServerCnt + 1
    Loop
    ' Enumerate Server Array
    For a = 0 To intServerCnt - 1
    strServer = Split(strServerList, vbcrlf)
    Next
    ' Create Excel Spreadsheet
    Set objXLA = CreateObject("Excel.Application")
    objXLA.Visible = False
    objXLA.DisplayAlerts = False
    Set objWorkbook = objXLA.Workbooks.Add()
    Set objWorksheet = objWorkbook.Worksheets(1)
    'Excel Constants
    Const xlEdgeLeft = 7
    Const xlContinuous = 1
    Const xlNone = -4142
    Const xlMedium = -4138
    Const xlThin = 2
    'Set Headers
    ' System Information
    objXLA.Cells(1,1).Value = "Service ID"
    objXLA.Cells(1,2).Value = "Company Name"
    objXLA.Cells(1,3).Value = "Manufacturer"
    objXLA.Cells(1,4).Value = "Model"
    objXLA.Cells(1,5).Value = "Operating System"
    ' Processors
    objXLA.Cells(1,6).Value = "Processor Type"
    objXLA.Cells(1,7).Value = "Processors"
    ' RAM
    objXLA.Cells(1,8).Value = "RAM"
    objXLA.Cells(1,9).Value = "Slots"
    objXLA.Cells(1,10).Value = "Max Capacity"
    ' Network
    objXLA.Cells(1,11).Value = "NIC Port"
    objXLA.Cells(1,12).Value = "Speed"
    objXLA.Cells(1,13).Value = "Connection Name"
    objXLA.Cells(1,14).Value = "Primary IP"
    objXLA.Cells(1,15).Value = "Virtual IP"
    objXLA.Cells(1,16).Value = "Primary DNS"
    objXLA.Cells(1,17).Value = "Secondary DNS"
    ' Hard Disks
    objXLA.Cells(1,18).Value = "Interface"
    objXLA.Cells(1,19).Value = "Physical Disks"
    objXLA.Cells(1,20).Value = "Disk Size"
    objXLA.Cells(1,21).Value = "Fault Tolerant"
    objXLA.Cells(1,22).Value = "Hot Spare"
    ' Set Top Line
    objXLA.Cells(1, 1).EntireRow.Font.Bold = True
    objXLA.Cells(1, 1).EntireRow.Font.Underline = True
    For b = 0 To UBound(strServer) - 1
    strServerParts = Split(strServer(b), " ")
    strComputer = strServerParts(0)
    ' Parse Server Information
    If UBound(strServerParts) = 2 Then
    strUsername = Trim(strServerParts(1))
    strPassword = Trim(strServerParts(2))
    End If
    ' Create Connection Object
    Set objWMIService = Nothing
    Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
    Set objWMIService = objSWbemLocator.ConnectServer _
    (strComputer, "root\cimv2", strUsername, strPassword)
    objWMIServices.Security_.ImpersonationLevel = 3
    ' Check if Server Exists
    For intWMICheck = 0 To 15
    If Not objWMIService Is Nothing Then
    Exit For
    Else
    WScript.Sleep(1000)
    End If
    Next
    ' Server Exists
    If intWMICheck < 15 Then
    ' Get CPU Information
    Set colProcessor = objWMIService.ExecQuery("SELECT * FROM Win32_Processor")
    For Each colProc In colProcessor
    strManuf = colProc.Manufacturer
    strDescription = ProcessorName(colProc.Name)
    strClockSpeed = colProc.CurrentClockSpeed
    strSocket = strSocket & colProc.SocketDesignation & vbcrlf
    strProcID = strProcID & colProc.ProcessorID & vbcrlf
    strUniqueID = strUniqueID & colProc.UniqueID & vbcrlf
    ProcCount = ProcCount + 1
    Next
    ' Determine if Hyperthreading is Enabled
    strHTStatus = GetHTStatus(strSocket, ProcCount, strProcID, strUniqueID)
    ' DC / HT Results
    If strHTStatus = "True" Then
    If InStr(strManuf, "Intel") Then
    strDescription = strDescription & " (Dual Core or H/T)"
    Else
    strDescription = strDescription & " (Dual Core)"
    End If
    ProcCount = ProcCount / 2
    End If
    ' Export Information
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colCS = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
    ' Write Basic System Information
    For Each objItem in colCS
    Set colOS = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
    For Each objItemOS in colOS
    ' Get SP Version
    If objItemOS.CSDVersion <> "" Then
    strSPVersion = objItemOS.CSDVersion
    Else
    strSPVersion = "No Service Packs Installed"
    End If
    If objItemOS.LastBootUpTime <> "" Then
    strLastBoot = DateConvert(objItemOS.LastBootUpTime)
    Else
    strLastBoot = "N/A"
    End If
    ' Set OS Version Information
    PUBOSVer = objItemOS.Caption
    objXLA.Cells(b + 2, 1).Value = objItemOS.csname
    objXLA.Cells(b + 2, 3).Value = objItem.Manufacturer
    objXLA.Cells(b + 2, 4).Value = objItem.Model
    objXLA.Cells(b + 2, 5).Value = PUBOSVer & " - " & strSPVersion
    objXLA.Cells(b + 2, 6).Value = strDescription
    objXLA.Cells(b + 2, 7).Value = ProcCount
    objXLA.Cells(b + 2, 8).Value = MemoryConvert(objItem.TotalPhysicalMemory)
    Next
    Next
    ' Get Memory Breakdown
    Dim strMemBreak
    strMemBreak = Split(MemoryBreakdown(), vbcrlf)
    n = 0
    For n = 0 To UBound(strMemBreak) - 1
    strSlots = strSlots & strMemBreak(n) & Chr(10)
    Next
    strMaxCapacity = strMemBreak(UBound(strMemBreak))
    objXLA.Cells(b + 2, 9).Value = Left(strSlots, Len(strSlots) - 1)
    objXLA.Cells(b + 2, 10).Value = strMaxCapacity
    ' Dispose
    strMemBreak = ""
    strMaxCapacity = ""
    strSlots = ""
    '--------------Computer Information (End)------------------'
    '-------------Partition Information (Start)----------------'
    ' Get Drive Count
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set DiskItemsParent = objWMIService.ExecQuery("Select * from Win32_DiskDrive")
    intCount = DiskItemsParent.Count
    ' Process Drives
    intDriveMark = 0
    For i = 0 To intCount - 1
    Set DiskItems = objWMIService.ExecQuery("Select * from Win32_DiskDrive WHERE Index = " & i)
    For Each diskItem in DiskItems
    ' Convert Drive Size
    If diskItem.Size <> "" Then strSize = strSize & ByteConvert(diskItem.Size) & Chr(10) Else strSize = "N/A" & Chr(10)
    If diskItem.StatusInfo <> "" Then strStsInfo = diskItem.StatusInfo Else strStsInfo = "N/A"
    If diskItem.SCSIBus <> "" Then strSCSIBus = diskItem.SCSIBus Else strSCSIBus = "N/A"
    If diskItem.SCSILogicalUnit <> "" Then strSCSILog = diskItem.SCSILogicalUnit Else strSCSILog = "N/A"
    If diskItem.SCSIPort <> "" Then strSCSIPort = diskItem.SCSIPort Else strSCSIPort = "N/A"
    If diskItem.SCSITargetId <> "" Then strSCSITarget = diskItem.SCSITargetId Else strSCSITarget = "N/A"
    ' Get Model
    strModel = Split(diskItem.Model, " ")
    ' Detect HP Array
    If (UCase(strModel(0)) = "HP" Or UCase(strModel(0)) = "COMPAQ") And intDriveMark = 0 Then
    strGetHPArray = GetHPArray(strComputer, strUsername, strPassword)
    If strGetHPArray <> "" Then
    strSplitHP = Split(strGetHPArray, Chr(13))
    For a = 0 To UBound(strSplitHP)
    strSplitResult = Split(strSplitHP(a), ":")
    i = i + 1
    strDriveCount = strDriveCount & Trim(strSplitResult(0)) & Chr(10)
    strDriveSize = strDriveSize & Trim(strSplitResult(1)) & Chr(10)
    strDriveFault = strDriveFault & Trim(strSplitResult(2)) & Chr(10)
    strDriveSpare = strDriveSpare & Trim(strSplitResult(3)) & Chr(10)
    strInterface = strInterface & "HP SCSI" & Chr(10)
    Next
    ' Set Controller Output
    objXLA.Cells(b + 2, 19).Value = Trim(Left(strDriveCount, Len(strDriveCount) - 1))
    objXLA.Cells(b + 2, 20).Value = Trim(Left(strDriveSize, Len(strDriveSize) - 1))
    objXLA.Cells(b + 2, 21).Value = Trim(Left(strDriveFault, Len(strDriveFault) - 1))
    objXLA.Cells(b + 2, 22).Value = Trim(Left(strDriveSpare, Len(strDriveSpare) - 1))
    intDriveMark = 1 ' Mark That Data was Obtained
    Else
    strDriveCount = strDriveCount & "1" & Chr(10)
    strDriveSize = strDriveSize & strSize & Chr(10)
    strDriveFault = strDriveFault & "N/A" & Chr(10)
    strDriveSpare = strDriveSpare & "N/A" & Chr(10)
    strInterface = strInterface & "HP SCSI " & Chr(10)
    ' Set Controller Output
    intDriveMark = 1 ' Mark That Another Pass is Invalid
    ' Set Controller Output
    objXLA.Cells(b + 2, 19).Value = Trim(Left(strDriveCount, Len(strDriveCount) - 1))
    objXLA.Cells(b + 2, 20).Value = Trim(Left(strDriveSize, Len(strDriveSize) - 1))
    objXLA.Cells(b + 2, 21).Value = Trim(Left(strDriveFault, Len(strDriveFault) - 1))
    objXLA.Cells(b + 2, 22).Value = Trim(Left(strDriveSpare, Len(strDriveSpare) - 1))
    End If
    Else
    strDriveCount = strDriveCount & "1" & Chr(10)
    strDriveSize = strDriveSize & strSize & Chr(10)
    strDriveFault = strDriveFault & "N/A" & Chr(10)
    strDriveSpare = strDriveSpare & "N/A" & Chr(10)
    ' Set Controller Output
    intDriveMark = 1 ' Mark That Another Pass is Invalid
    ' Set Controller Output
    objXLA.Cells(b + 2, 19).Value = Trim(Left(strDriveCount, Len(strDriveCount) - 1))
    objXLA.Cells(b + 2, 20).Value = Trim(Left(strDriveSize, Len(strDriveSize) - 1))
    objXLA.Cells(b + 2, 21).Value = Trim(Left(strDriveFault, Len(strDriveFault) - 1))
    objXLA.Cells(b + 2, 22).Value = Trim(Left(strDriveSpare, Len(strDriveSpare) - 1))
    ' Set Interface
    If diskItem.InterfaceType = "IDE" Then
    strInterface = strInterface & "ATA" & Chr(10)
    Else
    strInterface = strInterface & "SATA/SCSI" & Chr(10)
    End If
    End If
    ' Set Cell Value "Interface"
    objXLA.Cells(b + 2, 18).Value = Left(strInterface, Len(strInterface) - 1)
    Next
    ' Dispose Drive Sizes
    strDriveSize = ""
    Next
    ' Dispose Drive Values
    strDriveCount = ""
    strDriveFault = ""
    strDriveSpare = ""
    strInterface = ""
    '----Partition Information (End)---------------------------'
    '----Network Information (Start)---------------------------'
    Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter")
    i = 1
    eth = 0
    Dim STOREDIP(0)
    intNum = 0
    For Each objItem in colItems
    If objItem.NetConnectionStatus <> "" Then
    ' Determine Connection Status
    If objItem.NetConnectionStatus = 0 Then
    strNetStat = "Disabled"
    ElseIf objItem.NetConnectionStatus = 2 Then
    strNetStat = "Connected"
    ElseIf objItem.NetConnectionStatus = 7 Then
    strNetStat = "Disconnected"
    Else
    strNetStat = "Unknown"
    End If
    If objItem.NetConnectionStatus <> 0 Then
    ' Get Network Card Information
    Const HKEY_LOCAL_MACHINE = &H80000002
    strKeyPath1 = "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
    strKeyPath2 = "SYSTEM\CurrentControlSet\Services\NetBT\Parameters"
    strHostEntry = "Hostname"
    strDomainEntry = "Domain"
    strNodeEntry = "DhcpNodeType"
    strRoutingEntry = "IPEnableRouter"
    Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
    strComputer & "\root\default:StdRegProv")
    objReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,strHostEntry,strHostname
    objReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,strDomainEntry,strDomain
    objReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strNodeEntry,dwNodeType
    objReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath1,strRoutingEntry,dwIPRouting
    Select Case dwNodeType
    Case 4 strNodeType = "Mixed"
    Case 8 strNodeType = "Hybrid"
    Case Else strNodeType = dwNodeType
    End Select
    If dwIPRouting = 0 Then
    strIPRouting = "No"
    ElseIf dwIPRouting = 1 Then
    strIPRouting = "Yes"
    Else
    strIPRouting = "?"
    End If
    Set colFirstNicConfig = objWMIService.ExecQuery _
    ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
    For Each objFirstNicConfig In colFirstNicConfig
    strDnsWins = objFirstNicConfig.DNSEnabledForWINSResolution
    Next
    Set colNicConfigs = objWMIService.ExecQuery _
    ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
    ' Display per-adapter settings.
    For Each objNicConfig In colNicConfigs
    intIndex = objNicConfig.Index
    Set objNic = objWMIService.Get("Win32_NetworkAdapter.DeviceID=" & intIndex)
    ' Connection Name
    If GetOsVer > 5 Then
    ' Works only in XP / 2003
    strNetConn = objNic.NetConnectionID
    ElseIf GetOsVer = 5 Then
    strNetConn = ""
    ' Get Home Drive of Remote Server
    Set objShell = CreateObject("WScript.Shell")
    Set objEtherName = objShell.Exec("cmd /c ipconfig | find " & Chr(34) & "Ethernet" & Chr(34))
    strEtherName = objEtherName.StdOut.ReadAll()
    strEtherParse = Split(strEtherName, Chr(13))
    strEtherConn = Split(strEtherParse(eth), " ")
    For y = 2 To UBound(strEtherConn)
    strNetConn = strNetConn & " " & strEtherConn(y)
    Next
    ' Trim Connection Name
    strNetConn = Left(Trim(strNetConn), Len(Trim(strNetConn)) - 1)
    Else
    strNetConn = ""
    End If
    ' IP Addresses
    strIPAddresses = ""
    If Not IsNull(objNicConfig.IPAddress) Then
    For Each strIPAddress In objNicConfig.IPAddress
    strIPAddresses = strIPAddresses & strIPAddress & " "
    Next
    End If
    strIPCollection = Split(strIPAddresses, " ")
    ' Subnets
    strIPSubnets = ""
    If Not IsNull(objNicConfig.IPSubnet) Then
    For Each strIPSubnet In objNicConfig.IPSubnet
    strIPSubnets = strIPSubnets & strIPSubnet & " "
    Next
    End If
    strSMCollection = Split(strIPSubnets, " ")
    ' Virtual IP's
    strVirtual = ""
    If UBound(strIPCollection) > 1 Then
    For IPCount = 1 To UBound(strIPCollection) - 1
    strVirtual = strVirtual & (strIPCollection(IPCount) & " / " & strSMCollection(IPCount)) & Chr(10)
    Next
    strVirtual = Left(strVirtual, Len(strVirtual) - 1)
    End If
    If Trim(strVirtual) = "" Then strVirtual = "N/A"
    ' Gateways
    strDefaultIPGateways = ""
    If Not IsNull(objNicConfig.DefaultIPGateway) Then
    For Each strDefaultIPGateway In objNicConfig.DefaultIPGateway
    strDefaultIPGateways = strDefaultIPGateways & strDefaultIPGateway & " "
    Next
    Else
    strDefaultIPGateways = "N/A"
    End If
    ' If IP is repeated, and was already reported.
    intSkipLoop = 0
    If Trim(strNetConn) <> "" Then
    For j = 0 To intNum - 1
    If STOREDIP(j) = strIPAddresses Then
    intSkipLoop = 1
    Exit For
    End If
    Next
    If intSkipLoop = 0 Then
    ReDim Preserve STOREDIP(intNum)
    STOREDIP(intNum) = strIPAddresses
    intNum = intNum + 1
    End If
    Else
    intSkipLoop = 1
    End If
    ' DNS
    strDNSServerSearchOrder = ""
    If Not IsNull(objNicConfig.DNSServerSearchOrder) Then
    For Each strDNSServer In objNicConfig.DNSServerSearchOrder
    strDNSServerSearchOrder = strDNSServerSearchOrder & strDNSServer & " "
    Next
    strDNS = Split(strDNSServerSearchOrder, " ")
    strDNS1 = strDNS(0)
    If Trim(strDNS1) = "" Then strDNS1 = "N/A"
    If UBound(strDNS) > 1 Then
    strDNS2 = strDNS(1)
    Else
    strDNS2 = "N/A"
    End If
    Else
    strDNS1 = "N/A"
    strDNS2 = "N/A"
    End If
    ' Run Output Process
    If intSkipLoop = 0 Then
    ' Connection Speed
    strSpeed = "Unknown"
    Set objWMIService2 = objSWbemLocator.ConnectServer _
    (strComputer, "root\WMI", strUsername, strPassword)
    objWMIServices.Security_.ImpersonationLevel = 3
    Set listAdapters = objWMIService2.ExecQuery("SELECT * FROM MSNdis_LinkSpeed")
    Set enumAdapters = objWMIService2.ExecQuery("SELECT * FROM MSNdis_EnumerateAdapter")
    For Each objAdapter in listAdapters
    For Each objEnum in enumAdapters
    intEnum = Len(objEnum.DeviceName)
    If objNicConfig.SettingID = Right(objEnum.DeviceName, intEnum - 8) Then
    If objEnum.InstanceName = objAdapter.InstanceName Then
    intLength = Len(objAdapter.NdisLinkSpeed/10000)
    If intLength > 3 Then
    strSpeed = Left(objAdapter.NdisLinkSpeed/10000, intLength - 3)
    strSpeed = strSpeed & ".0 Gbps"
    Else
    strSpeed = objAdapter.NdisLinkSpeed/10000 & " Mbps"
    End If
    End If
    End If
    Next
    Next
    strTotalDesc = strTotalDesc & objNicConfig.Description & Chr(10)
    strTotalSpeed = strTotalSpeed & strSpeed & Chr(10)
    strTotalNetConn = strTotalNetConn & strNetConn & Chr(10)
    strPrimaryIP = strPrimaryIP & strIPCollection(0) & " / " & strSMCollection(0) & Chr(10)
    strDNSTotal1 = strDNSTotal1 & strDNS1 & Chr(10)
    strDNSTotal2 = strDNSTotal2 & strDNS2 & Chr(10)
    strTotalVirtual = strTotalVirtual & strVirtual & Chr(10)
    i = i + 1
    eth = eth + 2
    ' Dispose
    strDescription = ""
    ProcCount = 0
    strClockSpeed = ""
    strInterface = ""
    intCount = 0
    strSize = ""
    strSpeed = ""
    strIPCollection = ""
    strVirtual = ""
    strDNS = ""
    strDNS1 = ""
    strDNS2 = ""
    End If
    Next
    ' Output
    ' Trim Leading Chr(10)
    If Left(strPrimaryIP, 1) = Chr(10) Then strPrimaryIP = Right(strPrimaryIP, Len(strPrimaryIP) - 1)
    If Left(strTotalVirtual, 1) = Chr(10) Then strTotalVirtual = Right(strTotalVirtual, Len(strTotalVirtual) - 1)
    If Left(strDNSTotal1, 1) = Chr(10) Then strDNSTotal1 = Right(strDNSTotal1, Len(strDNSTotal1) - 1)
    If Left(strDNSTotal2, 1) = Chr(10) Then strDNSTotal2 = Right(strDNSTotal2, Len(strDNSTotal2) - 1)
    objXLA.Cells(b + 2, 11).Value = Trim(Left(strTotalDesc, Len(strTotalDesc) - 1))
    objXLA.Cells(b + 2, 12).Value = Trim(Left(strTotalSpeed, Len(strTotalSpeed) - 1))
    objXLA.Cells(b + 2, 13).Value = Trim(Left(strTotalNetConn, Len(strTotalNetConn) - 1))
    objXLA.Cells(b + 2, 14).Value = Trim(Left(strPrimaryIP, Len(strPrimaryIP) - 1))
    objXLA.Cells(b + 2, 15).Value = Trim(Left(strTotalVirtual, Len(strTotalVirtual) - 1))
    objXLA.Cells(b + 2, 16).Value = Trim(Left(strDNSTotal1, Len(strDNSTotal1) - 1))
    objXLA.Cells(b + 2, 17).Value = Trim(Left(strDNSTotal2, Len(strDNSTotal2) - 1))
    End If
    End If
    ' Dispose Per Loop
    strTotalDesc = ""
    strTotalSpeed = ""
    strTotalNetConn = ""
    strPrimaryIP = ""
    strDNSTotal1 = ""
    strDNSTotal2 = ""
    strTotalVirtual = ""
    Set eth = 0
    Set i = 0
    Next
    '------------Network Information (End)------------------'
    Else
    'No Data Present
    objXLA.Cells(b + 2, 1).Value = strComputer
    objXLA.Cells(b + 2, 3).Value = "Information Not Available"
    objXLA.Cells(b + 2, 1).EntireRow.Font.Bold = True
    objXLA.Cells(b + 2, 1).EntireRow.Interior.ColorIndex = 44
    End If
    ' Dispose Per Server
    ProcCount = 0
    strSocket = ""
    strProcID = ""
    strUniqueID = ""
    Set objWMIService = Nothing
    Next
    '-----------------Functions (Start)---------------------'
    ' System Memory Conversion
    Function MemoryConvert(strMem)
    Dim intLength
    Dim intExp
    Dim intSize
    Dim strSize
    Dim strMeasure
    Dim strMemory
    intLength = Len(strMem)
    If (intLength Mod 4 = 0) Then
    intExp = CInt((intLength / 3) - 2)
    Else
    intExp = CInt((intLength / 3) - 1)
    End If
    ' Convert to Lowest Integer Value
    For intCount = 1 To Len(intExp)
    chrRead = Mid(intExp, intCount, 1)
    If chrRead = "." Then
    Exit For
    Else
    strRead = strRead & chrRead
    End If
    Next
    intExp = Cint(strRead)
    intSize = CLng(strMem / (2 ^ (intExp * (10))))
    If Len(intSize) = 1 Then
    strFormat = FormatNumber(CStr(intSize), 2)
    Else
    strFormat = intSize + 1
    End If
    If (intExp = 1) Then
    strMeasure = "KB"
    ElseIf (intExp = 2) Then
    strMeasure = "MB"
    ElseIf (intExp = 3) Then
    strMeasure = "GB"
    ElseIf (intExp = 4) Then
    strMeasure = "TB"
    ElseIf (intExp = 5) Then
    strMeasure = "PB"
    ElseIf (intExp = 6) Then
    strMeasure = "EB"
    End If
    MemoryConvert = strFormat & " " & strMeasure
    End Function
    ' System Byte Conversion
    Function ByteConvert(strMem)
    Dim intLength
    Dim intExp
    Dim intSize
    Dim strSize
    Dim strMeasure
    Dim strMemory
    intLength = Len(strMem)
    If (intLength Mod 3 = 0) Then
    intExp = (intLength / 3) - 1
    Else
    intExp = (intLength / 3)
    End If
    ' Convert to Lowest Integer Value
    For intCount = 1 To Len(intExp)
    chrRead = Mid(intExp, intCount, 1)
    If chrRead = "." Then
    Exit For
    Else
    strRead = strRead & chrRead
    End If
    Next
    intExp = Cint(strRead)
    intSize = CLng(strMem / (2 ^ (intExp * (10))))
    strFormat = FormatNumber(CStr(intSize), 2)
    If (intExp = 1) Then
    strMeasure = "KB"
    ElseIf (intExp = 2) Then
    strMeasure = "MB"
    ElseIf (intExp = 3) Then
    strMeasure = "GB"
    ElseIf (intExp = 4) Then
    strMeasure = "TB"
    ElseIf (intExp = 5) Then
    strMeasure = "PB"
    ElseIf (intExp = 6) Then
    strMeasure = "EB"
    End If
    ByteConvert = strFormat & " " & strMeasure
    End Function
    ' System RAID Byte Conversion
    Function ByteConvertRAID(strMem)
    Dim intLength
    Dim intExp
    Dim intSize
    Dim strSize
    Dim strMeasure
    Dim strMemory
    intLength = Len(strMem)
    If (intLength Mod 3 = 0) Then
    intExp = (intLength / 3) - 1
    Else
    intExp = (intLength / 3)
    End If
    ' Convert to Lowest Integer Value
    For intCount = 1 To Len(intExp)
    chrRead = Mid(intExp, intCount, 1)
    If chrRead = "." Then
    Exit For
    Else
    strRead = strRead & chrRead
    End If
    Next
    intExp = Cint(strRead)
    intSize = (strMem / (2 ^ (intExp * (10))))
    strFormat = FormatNumber(CStr(intSize), 2)
    If (intExp = 0) Then
    strMeasure = "MB"
    ElseIf (intExp = 1) Then
    strMeasure = "GB"
    ElseIf (intExp = 2) Then
    strMeasure = "TB"
    ElseIf (intExp = 3) Then
    strMeasure = "PB"
    ElseIf (intExp = 4) Then
    strMeasure = "EB"
    End If
    ByteConvertRAID = strFormat & " " & strMeasure
    End Function
    ' Trim Processor Description
    Function ProcessorName(strName)
    Dim intCounter
    Dim strRead
    Dim chrRead, chrReadMore
    For intCounter = 1 to Len(strName)
    chrRead = Mid(strName, intCounter, 1)
    chrReadMore = Mid(strName, intCounter + 1, 1)
    If ((chrRead <> " ") Or ((chrRead = " ") And (chrReadMore <> " "))) Then
    strRead = strRead & chrRead
    End If
    Next
    ProcessorName = Trim(strRead)
    End Function
    ' Get Hyper-Threading Status
    Function GetHTStatus(strName, intProc, strID, strUnique)
    strNameArray = Split(strName, vbcrlf)
    strIDArray = Split(strID, vbcrlf)
    strUniqueList = Split(strUnique, vbcrlf)
    intTotal = 0
    ' Check Socket Designation
    For i = 0 To UBound(strNameArray) - 1
    intMark = 1
    ' Check for Redundancies
    For j = i + 1 To UBound(strNameArray) - 1
    If strNameArray(i) = strNameArray(j) Then
    intMark = 0
    End If
    Next
    ' If Redundant Unique ID's Exist
    For j = i + 1 To UBound(strNameArray) - 1
    If strUniqueList(i) <> "" And strUniqueList(j) <> "" And _
    (strUniqueList(i) <> strUniqueList(j)) Then
    intMark = 1
    End If
    Next
    ' Check for NULL ProcessorID
    If Trim(strIDArray(i)) = "0000000000000000" Then
    intMark = 0
    End If
    ' Calculate Total
    If intMark = 1 Then
    intTotal = intTotal + intMark
    End If
    Next
    ' Compare Results
    If intProc = 2 * intTotal Then
    GetHTStatus = "True"
    Else
    GetHTStatus = "False"
    End If
    End Function
    ' Get Memory Breakdown
    Function MemoryBreakdown
    Set colPMAItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemoryArray",,48)
    For Each objPMAItem in colPMAItems
    lngMax = CLng(objPMAItem.MaxCapacity)
    intCount = CInt(objPMAItem.MemoryDevices)
    Next
    ReDim Preserve strPMArray(intCount)
    Set colPMItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemory",,48)
    For Each objPMItem in colPMItems
    strValue = strValue & objPMItem.DeviceLocator & ": "
    strValue = strValue & objPMItem.Capacity / 2^20 & "MB, "
    strValue = strValue & objPMItem.Speed & "MHz"
    strPMArray(TrimTrailingNumber(objPMItem.Tag)) = strValue
    strValue = ""
    Next
    j = 0
    strResult = ""
    For j = 0 To intCount - 1
    If Trim(strPMArray(j)) = "" Then strPMArray(j) = "<Empty>"
    strResult = strResult & strPMArray(j) & vbcrlf
    Next
    strResult = strResult & (lngMax / 2^10) & "MB"
    MemoryBreakdown = strResult
    End Function
    ' Get Part Name
    Function ExtractPartName(strName)
    Dim chrRead
    Dim strRead
    Dim i
    For i = 2 To Len(strName)
    chrRead = Mid(strName, Len(strName) - (i - 1), 1)
    If chrRead <> Chr(34) Then
    strRead = chrRead & strRead
    Else
    Exit For
    End If
    Next
    ExtractPartName = strRead
    End Function
    ' Get Trailing Number
    Function TrimTrailingNumber(strNum)
    Dim chrRead
    Dim strRead
    Dim intLen
    strNum = Trim(strNum)
    intLen = Len(strNum)
    i = 1
    For i = 1 To intLen
    chrRead = Mid(strNum, intLen - (i - 1), 1)
    If IsNumeric(chrRead) = "True" Then
    strRead = chrRead & strRead
    Else
    Exit For
    End If
    Next
    TrimTrailingNumber = strRead
    End Function
    ' Function: WMIDateStringToDate(dtmDate)
    Function WMIDateToString(dtmDate)
    WMIDateToString = CDate(Mid(dtmDate, 5, 2) & "/" & _
    Mid(dtmDate, 7, 2) & "/" & _
    Left(dtmDate, 4) & " " & _
    Mid(dtmDate, 9, 2) & ":" & _
    Mid(dtmDate, 11, 2) & ":" & _
    Mid(dtmDate, 13, 2))
    End Function
    ' Function: GetOsVer
    Function GetOsVer
    Set colOperatingSystems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")
    For Each objOperatingSystem In colOperatingSystems
    GetOSVer = CSng(Left(objOperatingSystem.Version, 3))
    Next
    End Function
    ' Function: GetHPArray
    Function GetHPArray(strComputer2, strUsername2, strPassword2)
    ' Check for 64-bit Windows
    If InStr(PUBOSVer, "x64") Then
    strCompaq = "Program Files (x86)\Compaq\Cpqacuxe\Bin"
    Else
    strCompaq = "Program Files\Compaq\Cpqacuxe\Bin"
    End If
    ' Create Connection Object
    Set objWMIServiceRem = objWMIService.Get("Win32_Process")
    ' Confirm Location of Compaq Array Manager
    Set objHPShell = CreateObject("WScript.Shell")
    Set objHPFSO = CreateObject("Scripting.FileSystemObject")
    Set WshNetwork2 = WScript.CreateObject("WScript.Network")
    WshNetwork2.MapNetworkDrive "", "\\" & strComputer2 & "\C$" ,,strUsername2, strPassword2
    strProgram = "\\" & strComputer2 & "\C$\" & strCompaq & "\cpqacuxe.exe"
    ' Ensure Access is Possible
    If objHPFSO.FileExists(strProgram) Then
    ' Process Array Config
    strProcess = Chr(34) & "C:\" & strCompaq & "\cpqacuxe.exe" & Chr(34) & " -c c:\output.txt"
    Process = objWMIServiceRem.Create(strProcess, null, null, intProcessID)
    ' Check for "output.txt"
    For intTimerHP = 0 To 10
    If objFSO.FileExists("\\" & strComputer2 & "\C$\output.txt") Then
    Exit For
    Else
    WScript.Sleep(1000)
    End If
    Next
    ' Process Output
    If intTimerHP < 10 Then
    ' Check for Locked Output File
    Set objHPOutputFile = objHPFSO.GetFile("\\" & strComputer2 & "\C$\output.txt")
    If objHPOutputFile.Size <> 0 Then
    ' Close File
    Set objHPOutputFile = Nothing
    ' Continue Processesing File
    Set objHPInputFile = objHPFSO.OpenTextFile("\\" & strComputer2 & "\C$\output.txt", ForReading)
    Do Until objHPInputFile.AtEndOfStream
    strHPArray = strHPArray & objHPInputFile.ReadLine & vbcrlf
    Loop
    ' Close Input File
    objHPInputFile.Close
    ' Close Link to Server
    objHPFSO.DeleteFile("\\" & strComputer2 & "\C$\output.txt")
    Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
    Do While (objGetHPArray.Status = 0)
    WScript.Sleep(500)
    Loop
    ' Create String Array
    strHPParse = Split(strHPArray, vbcrlf)
    ' Parse For Individual RAID Arrays
    Dim strArrayList()
    z = 0
    For i = 0 To UBound(strHPParse)
    j = 0
    ' Array and Drives
    If InStr(strHPParse(i), "Array Specifications") Then
    ReDim Preserve strArrayList(z)
    strArrayList(z) = strArrayList(z) & strHPParse(i) & vbcrlf
    For j = i + 1 To Ubound(strHPParse)
    If InStr(strHPParse(j), "Array Specifications") Then
    Exit For
    Else
    strArrayList(z) = strArrayList(z) & strHPParse(j) & vbcrlf
    End If
    Next
    z = z + 1
    End If
    Next
    ' Process Each RAID Array
    x = 0
    For x = 0 To UBound(strArrayList)
    strListParse = Split(strArrayList(x), vbcrlf)
    For y = 0 To UBound(strListParse)
    ' Drives
    If Left(strListParse(y), 6) = "Drive=" Then
    strDrives = ""
    strDrives = Split(strListParse(y), ",")
    k = 0
    For j = 0 To UBound(strDrives)
    k = k + 1
    Next
    strDriveCount = k ' For Output
    End If
    ' Hot Spare
    If InStr(strListParse(y), "OnlineSpare=") Then
    If InStr(strListParse(y), "OnlineSpare= No") Then
    strHotSpare = strHotSpare & "N" ' For Output
    Else
    strHotSpare = strHotSpare & "Y" ' For Output
    End If
    End If
    ' Logical Drives
    If InStr(strListParse(y), "Logical Drive Specifications") Then
    ' Find First Logical Drive
    strRAID = Split(strListParse(y + 2), " ")
    strRAIDResult = strRAIDResult & "RAID " & strRAID(1) & " / " ' For Output
    strGetDrive = Split(strListParse(y + 3), " ")
    strRAIDSize = strRAIDSize & ByteConvertRAID(strGetDrive(1)) & " / " ' For Output
    End If
    Next
    ' Process Results
    strRAIDSize = Left(strRAIDSize, Len(strRAIDSize) - 3)
    strRAIDResult = Left(strRAIDResult, Len(strRAIDResult) - 3)
    strNewList = strNewList & strDriveCount & _
    ":" & strRAIDSize & ":" & strRAIDResult & ":" & strHotSpare & Chr(13)
    ' Dispose Array Variables
    strDriveCount = ""
    strRAIDSize = ""
    strRAIDResult = ""
    strHotSpare = ""
    Next
    ' Return Array Output
    GetHPArray = Left(strNewList, Len(strNewList) - 1)
    Exit Function
    Else ' "output.txt" Is Locked
    ' Close File
    Set objHPOutputFile = Nothing
    ' Kill Remote Connection
    Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
    Do While (objGetHPArray.Status = 0)
    WScript.Sleep(500)
    Loop
    GetHPArray = ""
    Exit Function
    End If
    Else ' "output.txt" Does not Exist
    ' Kill Remote Connection
    Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
    Do While (objGetHPArray.Status = 0)
    WScript.Sleep(500)
    Loop
    GetHPArray = ""
    Exit Function
    End If
    Else ' "Array Manager Does not Exist
    ' Input not Available
    Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
    Do While (objGetHPArray.Status = 0)
    WScript.Sleep(500)
    Loop
    GetHPArray = ""
    Exit Function
    End If
    End Function
    '--------------------Functions (End)--------------------'
    ' Set Excel Attributes
    Const xlVAlignTop = -4160
    Set objRange2 = objWorksheet.UsedRange
    objRange2.VerticalAlignment = xlVAlignTop
    ' Set Font Attributes
    objXLA.Cells.Font.Size = 8
    objXLA.Cells.Font.Name = "Arial"
    objXLA.Cells.Font.ColorIndex = 11
    objXLA.Cells.EntireColumn.AutoFit
    objXLA.Cells(1, 9).ColumnWidth = 30 ' RAM Slots
    objXLA.Cells(1, 11).ColumnWidth = 40 ' NIC Port
    objXLA.Cells(1, 13).ColumnWidth = 25 ' Connection Name
    objXLA.Cells(1, 14).ColumnWidth = 25 ' Interface IP's
    objXLA.Cells(1, 15).ColumnWidth = 25 ' Virtual IP's
    objXLA.Cells(1, 16).ColumnWidth = 15 ' DNS1
    objXLA.Cells(1, 17).ColumnWidth = 15 ' DNS2
    objXLA.Cells(1, 18).ColumnWidth = 15 ' Interface Type
    objXLA.Cells.HorizontalAlignment = 2 ' Drive Count
    objXLA.Cells(1, 20).ColumnWidth = 20 ' Virtual IP's
    objXLA.Cells(1, 21).ColumnWidth = 20 ' Virtual IP's
    ' Save
    set objFSO2 = CreateObject("Scripting.FileSystemObject")
    strFileName = objFSO2.getAbsolutePathName("") & "\Scan Results.xls"
    objWorkbook.SaveAs(strFileName)
    objWorkbook.Close
    objXLA.Quit
    ' Notify User
    WScript.Echo "Process Completed (" & Now & ")"
    ' Close Program
    WScript.Quit(0)

    I Need my script modified to run this script and output to CSV but its so big I am not sure where to start. I don't need it in XLS at all, and I can add my own headers, cell sizes and colors, etc. so It should just output the data to a simple CSV. 
    On Error Resume Next
    Dim PUBOSVer ' Global OS Version
    ' Open File For Writing
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    Const ForReading = 1
    ' Get Server List
    strServerFilename = "servers.txt"
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    If objFSO.FileExists(strServerFilename) Then
    ' Open Servers File
    Set objServers = objFSO.OpenTextFile(strServerFilename, ForReading)
    Else
    ' Server File is missing: Exit
    intMsg = MsgBox("File: " & Chr(34) & UCASE(strServerFilename) & Chr(34) & _
    " is either " & _
    "Missing or Damaged!" & vbcrlf & _
    vbcrlf & _
    "This Script will now Exit.", vbCritical, "Server File Error")
    WScript.Quit(0)
    End If
    Do Until objServers.AtEndOfStream
    strNewServer = Trim(objServers.ReadLine)
    strServerList = strServerList & strNewServer & vbcrlf
    intServerCnt = intServerCnt + 1
    Loop
    ' Enumerate Server Array
    For a = 0 To intServerCnt - 1
    strServer = Split(strServerList, vbcrlf)
    Next
    ' Create Excel Spreadsheet
    Set objXLA = CreateObject("Excel.Application")
    objXLA.Visible = False
    objXLA.DisplayAlerts = False
    Set objWorkbook = objXLA.Workbooks.Add()
    Set objWorksheet = objWorkbook.Worksheets(1)
    'Excel Constants
    Const xlEdgeLeft = 7
    Const xlContinuous = 1
    Const xlNone = -4142
    Const xlMedium = -4138
    Const xlThin = 2
    'Set Headers
    ' System Information
    objXLA.Cells(1,1).Value = "Service ID"
    objXLA.Cells(1,2).Value = "Company Name"
    objXLA.Cells(1,3).Value = "Manufacturer"
    objXLA.Cells(1,4).Value = "Model"
    objXLA.Cells(1,5).Value = "Operating System"
    ' Processors
    objXLA.Cells(1,6).Value = "Processor Type"
    objXLA.Cells(1,7).Value = "Processors"
    ' RAM
    objXLA.Cells(1,8).Value = "RAM"
    objXLA.Cells(1,9).Value = "Slots"
    objXLA.Cells(1,10).Value = "Max Capacity"
    ' Network
    objXLA.Cells(1,11).Value = "NIC Port"
    objXLA.Cells(1,12).Value = "Speed"
    objXLA.Cells(1,13).Value = "Connection Name"
    objXLA.Cells(1,14).Value = "Primary IP"
    objXLA.Cells(1,15).Value = "Virtual IP"
    objXLA.Cells(1,16).Value = "Primary DNS"
    objXLA.Cells(1,17).Value = "Secondary DNS"
    ' Hard Disks
    objXLA.Cells(1,18).Value = "Interface"
    objXLA.Cells(1,19).Value = "Physical Disks"
    objXLA.Cells(1,20).Value = "Disk Size"
    objXLA.Cells(1,21).Value = "Fault Tolerant"
    objXLA.Cells(1,22).Value = "Hot Spare"
    ' Set Top Line
    objXLA.Cells(1, 1).EntireRow.Font.Bold = True
    objXLA.Cells(1, 1).EntireRow.Font.Underline = True
    For b = 0 To UBound(strServer) - 1
    strServerParts = Split(strServer(b), " ")
    strComputer = strServerParts(0)
    ' Parse Server Information
    If UBound(strServerParts) = 2 Then
    strUsername = Trim(strServerParts(1))
    strPassword = Trim(strServerParts(2))
    End If
    ' Create Connection Object
    Set objWMIService = Nothing
    Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
    Set objWMIService = objSWbemLocator.ConnectServer _
    (strComputer, "root\cimv2", strUsername, strPassword)
    objWMIServices.Security_.ImpersonationLevel = 3
    ' Check if Server Exists
    For intWMICheck = 0 To 15
    If Not objWMIService Is Nothing Then
    Exit For
    Else
    WScript.Sleep(1000)
    End If
    Next
    ' Server Exists
    If intWMICheck < 15 Then
    ' Get CPU Information
    Set colProcessor = objWMIService.ExecQuery("SELECT * FROM Win32_Processor")
    For Each colProc In colProcessor
    strManuf = colProc.Manufacturer
    strDescription = ProcessorName(colProc.Name)
    strClockSpeed = colProc.CurrentClockSpeed
    strSocket = strSocket & colProc.SocketDesignation & vbcrlf
    strProcID = strProcID & colProc.ProcessorID & vbcrlf
    strUniqueID = strUniqueID & colProc.UniqueID & vbcrlf
    ProcCount = ProcCount + 1
    Next
    ' Determine if Hyperthreading is Enabled
    strHTStatus = GetHTStatus(strSocket, ProcCount, strProcID, strUniqueID)
    ' DC / HT Results
    If strHTStatus = "True" Then
    If InStr(strManuf, "Intel") Then
    strDescription = strDescription & " (Dual Core or H/T)"
    Else
    strDescription = strDescription & " (Dual Core)"
    End If
    ProcCount = ProcCount / 2
    End If
    ' Export Information
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colCS = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
    ' Write Basic System Information
    For Each objItem in colCS
    Set colOS = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
    For Each objItemOS in colOS
    ' Get SP Version
    If objItemOS.CSDVersion <> "" Then
    strSPVersion = objItemOS.CSDVersion
    Else
    strSPVersion = "No Service Packs Installed"
    End If
    If objItemOS.LastBootUpTime <> "" Then
    strLastBoot = DateConvert(objItemOS.LastBootUpTime)
    Else
    strLastBoot = "N/A"
    End If
    ' Set OS Version Information
    PUBOSVer = objItemOS.Caption
    objXLA.Cells(b + 2, 1).Value = objItemOS.csname
    objXLA.Cells(b + 2, 3).Value = objItem.Manufacturer
    objXLA.Cells(b + 2, 4).Value = objItem.Model
    objXLA.Cells(b + 2, 5).Value = PUBOSVer & " - " & strSPVersion
    objXLA.Cells(b + 2, 6).Value = strDescription
    objXLA.Cells(b + 2, 7).Value = ProcCount
    objXLA.Cells(b + 2, 8).Value = MemoryConvert(objItem.TotalPhysicalMemory)
    Next
    Next
    ' Get Memory Breakdown
    Dim strMemBreak
    strMemBreak = Split(MemoryBreakdown(), vbcrlf)
    n = 0
    For n = 0 To UBound(strMemBreak) - 1
    strSlots = strSlots & strMemBreak(n) & Chr(10)
    Next
    strMaxCapacity = strMemBreak(UBound(strMemBreak))
    objXLA.Cells(b + 2, 9).Value = Left(strSlots, Len(strSlots) - 1)
    objXLA.Cells(b + 2, 10).Value = strMaxCapacity
    ' Dispose
    strMemBreak = ""
    strMaxCapacity = ""
    strSlots = ""
    '--------------Computer Information (End)------------------'
    '-------------Partition Information (Start)----------------'
    ' Get Drive Count
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set DiskItemsParent = objWMIService.ExecQuery("Select * from Win32_DiskDrive")
    intCount = DiskItemsParent.Count
    ' Process Drives
    intDriveMark = 0
    For i = 0 To intCount - 1
    Set DiskItems = objWMIService.ExecQuery("Select * from Win32_DiskDrive WHERE Index = " & i)
    For Each diskItem in DiskItems
    ' Convert Drive Size
    If diskItem.Size <> "" Then strSize = strSize & ByteConvert(diskItem.Size) & Chr(10) Else strSize = "N/A" & Chr(10)
    If diskItem.StatusInfo <> "" Then strStsInfo = diskItem.StatusInfo Else strStsInfo = "N/A"
    If diskItem.SCSIBus <> "" Then strSCSIBus = diskItem.SCSIBus Else strSCSIBus = "N/A"
    If diskItem.SCSILogicalUnit <> "" Then strSCSILog = diskItem.SCSILogicalUnit Else strSCSILog = "N/A"
    If diskItem.SCSIPort <> "" Then strSCSIPort = diskItem.SCSIPort Else strSCSIPort = "N/A"
    If diskItem.SCSITargetId <> "" Then strSCSITarget = diskItem.SCSITargetId Else strSCSITarget = "N/A"
    ' Get Model
    strModel = Split(diskItem.Model, " ")
    ' Detect HP Array
    If (UCase(strModel(0)) = "HP" Or UCase(strModel(0)) = "COMPAQ") And intDriveMark = 0 Then
    strGetHPArray = GetHPArray(strComputer, strUsername, strPassword)
    If strGetHPArray <> "" Then
    strSplitHP = Split(strGetHPArray, Chr(13))
    For a = 0 To UBound(strSplitHP)
    strSplitResult = Split(strSplitHP(a), ":")
    i = i + 1
    strDriveCount = strDriveCount & Trim(strSplitResult(0)) & Chr(10)
    strDriveSize = strDriveSize & Trim(strSplitResult(1)) & Chr(10)
    strDriveFault = strDriveFault & Trim(strSplitResult(2)) & Chr(10)
    strDriveSpare = strDriveSpare & Trim(strSplitResult(3)) & Chr(10)
    strInterface = strInterface & "HP SCSI" & Chr(10)
    Next
    ' Set Controller Output
    objXLA.Cells(b + 2, 19).Value = Trim(Left(strDriveCount, Len(strDriveCount) - 1))
    objXLA.Cells(b + 2, 20).Value = Trim(Left(strDriveSize, Len(strDriveSize) - 1))
    objXLA.Cells(b + 2, 21).Value = Trim(Left(strDriveFault, Len(strDriveFault) - 1))
    objXLA.Cells(b + 2, 22).Value = Trim(Left(strDriveSpare, Len(strDriveSpare) - 1))
    intDriveMark = 1 ' Mark That Data was Obtained
    Else
    strDriveCount = strDriveCount & "1" & Chr(10)
    strDriveSize = strDriveSize & strSize & Chr(10)
    strDriveFault = strDriveFault & "N/A" & Chr(10)
    strDriveSpare = strDriveSpare & "N/A" & Chr(10)
    strInterface = strInterface & "HP SCSI " & Chr(10)
    ' Set Controller Output
    intDriveMark = 1 ' Mark That Another Pass is Invalid
    ' Set Controller Output
    objXLA.Cells(b + 2, 19).Value = Trim(Left(strDriveCount, Len(strDriveCount) - 1))
    objXLA.Cells(b + 2, 20).Value = Trim(Left(strDriveSize, Len(strDriveSize) - 1))
    objXLA.Cells(b + 2, 21).Value = Trim(Left(strDriveFault, Len(strDriveFault) - 1))
    objXLA.Cells(b + 2, 22).Value = Trim(Left(strDriveSpare, Len(strDriveSpare) - 1))
    End If
    Else
    strDriveCount = strDriveCount & "1" & Chr(10)
    strDriveSize = strDriveSize & strSize & Chr(10)
    strDriveFault = strDriveFault & "N/A" & Chr(10)
    strDriveSpare = strDriveSpare & "N/A" & Chr(10)
    ' Set Controller Output
    intDriveMark = 1 ' Mark That Another Pass is Invalid
    ' Set Controller Output
    objXLA.Cells(b + 2, 19).Value = Trim(Left(strDriveCount, Len(strDriveCount) - 1))
    objXLA.Cells(b + 2, 20).Value = Trim(Left(strDriveSize, Len(strDriveSize) - 1))
    objXLA.Cells(b + 2, 21).Value = Trim(Left(strDriveFault, Len(strDriveFault) - 1))
    objXLA.Cells(b + 2, 22).Value = Trim(Left(strDriveSpare, Len(strDriveSpare) - 1))
    ' Set Interface
    If diskItem.InterfaceType = "IDE" Then
    strInterface = strInterface & "ATA" & Chr(10)
    Else
    strInterface = strInterface & "SATA/SCSI" & Chr(10)
    End If
    End If
    ' Set Cell Value "Interface"
    objXLA.Cells(b + 2, 18).Value = Left(strInterface, Len(strInterface) - 1)
    Next
    ' Dispose Drive Sizes
    strDriveSize = ""
    Next
    ' Dispose Drive Values
    strDriveCount = ""
    strDriveFault = ""
    strDriveSpare = ""
    strInterface = ""
    '----Partition Information (End)---------------------------'
    '----Network Information (Start)---------------------------'
    Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter")
    i = 1
    eth = 0
    Dim STOREDIP(0)
    intNum = 0
    For Each objItem in colItems
    If objItem.NetConnectionStatus <> "" Then
    ' Determine Connection Status
    If objItem.NetConnectionStatus = 0 Then
    strNetStat = "Disabled"
    ElseIf objItem.NetConnectionStatus = 2 Then
    strNetStat = "Connected"
    ElseIf objItem.NetConnectionStatus = 7 Then
    strNetStat = "Disconnected"
    Else
    strNetStat = "Unknown"
    End If
    If objItem.NetConnectionStatus <> 0 Then
    ' Get Network Card Information
    Const HKEY_LOCAL_MACHINE = &H80000002
    strKeyPath1 = "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
    strKeyPath2 = "SYSTEM\CurrentControlSet\Services\NetBT\Parameters"
    strHostEntry = "Hostname"
    strDomainEntry = "Domain"
    strNodeEntry = "DhcpNodeType"
    strRoutingEntry = "IPEnableRouter"
    Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
    strComputer & "\root\default:StdRegProv")
    objReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,strHostEntry,strHostname
    objReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,strDomainEntry,strDomain
    objReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strNodeEntry,dwNodeType
    objReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath1,strRoutingEntry,dwIPRouting
    Select Case dwNodeType
    Case 4 strNodeType = "Mixed"
    Case 8 strNodeType = "Hybrid"
    Case Else strNodeType = dwNodeType
    End Select
    If dwIPRouting = 0 Then
    strIPRouting = "No"
    ElseIf dwIPRouting = 1 Then
    strIPRouting = "Yes"
    Else
    strIPRouting = "?"
    End If
    Set colFirstNicConfig = objWMIService.ExecQuery _
    ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
    For Each objFirstNicConfig In colFirstNicConfig
    strDnsWins = objFirstNicConfig.DNSEnabledForWINSResolution
    Next
    Set colNicConfigs = objWMIService.ExecQuery _
    ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
    ' Display per-adapter settings.
    For Each objNicConfig In colNicConfigs
    intIndex = objNicConfig.Index
    Set objNic = objWMIService.Get("Win32_NetworkAdapter.DeviceID=" & intIndex)
    ' Connection Name
    If GetOsVer > 5 Then
    ' Works only in XP / 2003
    strNetConn = objNic.NetConnectionID
    ElseIf GetOsVer = 5 Then
    strNetConn = ""
    ' Get Home Drive of Remote Server
    Set objShell = CreateObject("WScript.Shell")
    Set objEtherName = objShell.Exec("cmd /c ipconfig | find " & Chr(34) & "Ethernet" & Chr(34))
    strEtherName = objEtherName.StdOut.ReadAll()
    strEtherParse = Split(strEtherName, Chr(13))
    strEtherConn = Split(strEtherParse(eth), " ")
    For y = 2 To UBound(strEtherConn)
    strNetConn = strNetConn & " " & strEtherConn(y)
    Next
    ' Trim Connection Name
    strNetConn = Left(Trim(strNetConn), Len(Trim(strNetConn)) - 1)
    Else
    strNetConn = ""
    End If
    ' IP Addresses
    strIPAddresses = ""
    If Not IsNull(objNicConfig.IPAddress) Then
    For Each strIPAddress In objNicConfig.IPAddress
    strIPAddresses = strIPAddresses & strIPAddress & " "
    Next
    End If
    strIPCollection = Split(strIPAddresses, " ")
    ' Subnets
    strIPSubnets = ""
    If Not IsNull(objNicConfig.IPSubnet) Then
    For Each strIPSubnet In objNicConfig.IPSubnet
    strIPSubnets = strIPSubnets & strIPSubnet & " "
    Next
    End If
    strSMCollection = Split(strIPSubnets, " ")
    ' Virtual IP's
    strVirtual = ""
    If UBound(strIPCollection) > 1 Then
    For IPCount = 1 To UBound(strIPCollection) - 1
    strVirtual = strVirtual & (strIPCollection(IPCount) & " / " & strSMCollection(IPCount)) & Chr(10)
    Next
    strVirtual = Left(strVirtual, Len(strVirtual) - 1)
    End If
    If Trim(strVirtual) = "" Then strVirtual = "N/A"
    ' Gateways
    strDefaultIPGateways = ""
    If Not IsNull(objNicConfig.DefaultIPGateway) Then
    For Each strDefaultIPGateway In objNicConfig.DefaultIPGateway
    strDefaultIPGateways = strDefaultIPGateways & strDefaultIPGateway & " "
    Next
    Else
    strDefaultIPGateways = "N/A"
    End If
    ' If IP is repeated, and was already reported.
    intSkipLoop = 0
    If Trim(strNetConn) <> "" Then
    For j = 0 To intNum - 1
    If STOREDIP(j) = strIPAddresses Then
    intSkipLoop = 1
    Exit For
    End If
    Next
    If intSkipLoop = 0 Then
    ReDim Preserve STOREDIP(intNum)
    STOREDIP(intNum) = strIPAddresses
    intNum = intNum + 1
    End If
    Else
    intSkipLoop = 1
    End If
    ' DNS
    strDNSServerSearchOrder = ""
    If Not IsNull(objNicConfig.DNSServerSearchOrder) Then
    For Each strDNSServer In objNicConfig.DNSServerSearchOrder
    strDNSServerSearchOrder = strDNSServerSearchOrder & strDNSServer & " "
    Next
    strDNS = Split(strDNSServerSearchOrder, " ")
    strDNS1 = strDNS(0)
    If Trim(strDNS1) = "" Then strDNS1 = "N/A"
    If UBound(strDNS) > 1 Then
    strDNS2 = strDNS(1)
    Else
    strDNS2 = "N/A"
    End If
    Else
    strDNS1 = "N/A"
    strDNS2 = "N/A"
    End If
    ' Run Output Process
    If intSkipLoop = 0 Then
    ' Connection Speed
    strSpeed = "Unknown"
    Set objWMIService2 = objSWbemLocator.ConnectServer _
    (strComputer, "root\WMI", strUsername, strPassword)
    objWMIServices.Security_.ImpersonationLevel = 3
    Set listAdapters = objWMIService2.ExecQuery("SELECT * FROM MSNdis_LinkSpeed")
    Set enumAdapters = objWMIService2.ExecQuery("SELECT * FROM MSNdis_EnumerateAdapter")
    For Each objAdapter in listAdapters
    For Each objEnum in enumAdapters
    intEnum = Len(objEnum.DeviceName)
    If objNicConfig.SettingID = Right(objEnum.DeviceName, intEnum - 8) Then
    If objEnum.InstanceName = objAdapter.InstanceName Then
    intLength = Len(objAdapter.NdisLinkSpeed/10000)
    If intLength > 3 Then
    strSpeed = Left(objAdapter.NdisLinkSpeed/10000, intLength - 3)
    strSpeed = strSpeed & ".0 Gbps"
    Else
    strSpeed = objAdapter.NdisLinkSpeed/10000 & " Mbps"
    End If
    End If
    End If
    Next
    Next
    strTotalDesc = strTotalDesc & objNicConfig.Description & Chr(10)
    strTotalSpeed = strTotalSpeed & strSpeed & Chr(10)
    strTotalNetConn = strTotalNetConn & strNetConn & Chr(10)
    strPrimaryIP = strPrimaryIP & strIPCollection(0) & " / " & strSMCollection(0) & Chr(10)
    strDNSTotal1 = strDNSTotal1 & strDNS1 & Chr(10)
    strDNSTotal2 = strDNSTotal2 & strDNS2 & Chr(10)
    strTotalVirtual = strTotalVirtual & strVirtual & Chr(10)
    i = i + 1
    eth = eth + 2
    ' Dispose
    strDescription = ""
    ProcCount = 0
    strClockSpeed = ""
    strInterface = ""
    intCount = 0
    strSize = ""
    strSpeed = ""
    strIPCollection = ""
    strVirtual = ""
    strDNS = ""
    strDNS1 = ""
    strDNS2 = ""
    End If
    Next
    ' Output
    ' Trim Leading Chr(10)
    If Left(strPrimaryIP, 1) = Chr(10) Then strPrimaryIP = Right(strPrimaryIP, Len(strPrimaryIP) - 1)
    If Left(strTotalVirtual, 1) = Chr(10) Then strTotalVirtual = Right(strTotalVirtual, Len(strTotalVirtual) - 1)
    If Left(strDNSTotal1, 1) = Chr(10) Then strDNSTotal1 = Right(strDNSTotal1, Len(strDNSTotal1) - 1)
    If Left(strDNSTotal2, 1) = Chr(10) Then strDNSTotal2 = Right(strDNSTotal2, Len(strDNSTotal2) - 1)
    objXLA.Cells(b + 2, 11).Value = Trim(Left(strTotalDesc, Len(strTotalDesc) - 1))
    objXLA.Cells(b + 2, 12).Value = Trim(Left(strTotalSpeed, Len(strTotalSpeed) - 1))
    objXLA.Cells(b + 2, 13).Value = Trim(Left(strTotalNetConn, Len(strTotalNetConn) - 1))
    objXLA.Cells(b + 2, 14).Value = Trim(Left(strPrimaryIP, Len(strPrimaryIP) - 1))
    objXLA.Cells(b + 2, 15).Value = Trim(Left(strTotalVirtual, Len(strTotalVirtual) - 1))
    objXLA.Cells(b + 2, 16).Value = Trim(Left(strDNSTotal1, Len(strDNSTotal1) - 1))
    objXLA.Cells(b + 2, 17).Value = Trim(Left(strDNSTotal2, Len(strDNSTotal2) - 1))
    End If
    End If
    ' Dispose Per Loop
    strTotalDesc = ""
    strTotalSpeed = ""
    strTotalNetConn = ""
    strPrimaryIP = ""
    strDNSTotal1 = ""
    strDNSTotal2 = ""
    strTotalVirtual = ""
    Set eth = 0
    Set i = 0
    Next
    '------------Network Information (End)------------------'
    Else
    'No Data Present
    objXLA.Cells(b + 2, 1).Value = strComputer
    objXLA.Cells(b + 2, 3).Value = "Information Not Available"
    objXLA.Cells(b + 2, 1).EntireRow.Font.Bold = True
    objXLA.Cells(b + 2, 1).EntireRow.Interior.ColorIndex = 44
    End If
    ' Dispose Per Server
    ProcCount = 0
    strSocket = ""
    strProcID = ""
    strUniqueID = ""
    Set objWMIService = Nothing
    Next
    '-----------------Functions (Start)---------------------'
    ' System Memory Conversion
    Function MemoryConvert(strMem)
    Dim intLength
    Dim intExp
    Dim intSize
    Dim strSize
    Dim strMeasure
    Dim strMemory
    intLength = Len(strMem)
    If (intLength Mod 4 = 0) Then
    intExp = CInt((intLength / 3) - 2)
    Else
    intExp = CInt((intLength / 3) - 1)
    End If
    ' Convert to Lowest Integer Value
    For intCount = 1 To Len(intExp)
    chrRead = Mid(intExp, intCount, 1)
    If chrRead = "." Then
    Exit For
    Else
    strRead = strRead & chrRead
    End If
    Next
    intExp = Cint(strRead)
    intSize = CLng(strMem / (2 ^ (intExp * (10))))
    If Len(intSize) = 1 Then
    strFormat = FormatNumber(CStr(intSize), 2)
    Else
    strFormat = intSize + 1
    End If
    If (intExp = 1) Then
    strMeasure = "KB"
    ElseIf (intExp = 2) Then
    strMeasure = "MB"
    ElseIf (intExp = 3) Then
    strMeasure = "GB"
    ElseIf (intExp = 4) Then
    strMeasure = "TB"
    ElseIf (intExp = 5) Then
    strMeasure = "PB"
    ElseIf (intExp = 6) Then
    strMeasure = "EB"
    End If
    MemoryConvert = strFormat & " " & strMeasure
    End Function
    ' System Byte Conversion
    Function ByteConvert(strMem)
    Dim intLength
    Dim intExp
    Dim intSize
    Dim strSize
    Dim strMeasure
    Dim strMemory
    intLength = Len(strMem)
    If (intLength Mod 3 = 0) Then
    intExp = (intLength / 3) - 1
    Else
    intExp = (intLength / 3)
    End If
    ' Convert to Lowest Integer Value
    For intCount = 1 To Len(intExp)
    chrRead = Mid(intExp, intCount, 1)
    If chrRead = "." Then
    Exit For
    Else
    strRead = strRead & chrRead
    End If
    Next
    intExp = Cint(strRead)
    intSize = CLng(strMem / (2 ^ (intExp * (10))))
    strFormat = FormatNumber(CStr(intSize), 2)
    If (intExp = 1) Then
    strMeasure = "KB"
    ElseIf (intExp = 2) Then
    strMeasure = "MB"
    ElseIf (intExp = 3) Then
    strMeasure = "GB"
    ElseIf (intExp = 4) Then
    strMeasure = "TB"
    ElseIf (intExp = 5) Then
    strMeasure = "PB"
    ElseIf (intExp = 6) Then
    strMeasure = "EB"
    End If
    ByteConvert = strFormat & " " & strMeasure
    End Function
    ' System RAID Byte Conversion
    Function ByteConvertRAID(strMem)
    Dim intLength
    Dim intExp
    Dim intSize
    Dim strSize
    Dim strMeasure
    Dim strMemory
    intLength = Len(strMem)
    If (intLength Mod 3 = 0) Then
    intExp = (intLength / 3) - 1
    Else
    intExp = (intLength / 3)
    End If
    ' Convert to Lowest Integer Value
    For intCount = 1 To Len(intExp)
    chrRead = Mid(intExp, intCount, 1)
    If chrRead = "." Then
    Exit For
    Else
    strRead = strRead & chrRead
    End If
    Next
    intExp = Cint(strRead)
    intSize = (strMem / (2 ^ (intExp * (10))))
    strFormat = FormatNumber(CStr(intSize), 2)
    If (intExp = 0) Then
    strMeasure = "MB"
    ElseIf (intExp = 1) Then
    strMeasure = "GB"
    ElseIf (intExp = 2) Then
    strMeasure = "TB"
    ElseIf (intExp = 3) Then
    strMeasure = "PB"
    ElseIf (intExp = 4) Then
    strMeasure = "EB"
    End If
    ByteConvertRAID = strFormat & " " & strMeasure
    End Function
    ' Trim Processor Description
    Function ProcessorName(strName)
    Dim intCounter
    Dim strRead
    Dim chrRead, chrReadMore
    For intCounter = 1 to Len(strName)
    chrRead = Mid(strName, intCounter, 1)
    chrReadMore = Mid(strName, intCounter + 1, 1)
    If ((chrRead <> " ") Or ((chrRead = " ") And (chrReadMore <> " "))) Then
    strRead = strRead & chrRead
    End If
    Next
    ProcessorName = Trim(strRead)
    End Function
    ' Get Hyper-Threading Status
    Function GetHTStatus(strName, intProc, strID, strUnique)
    strNameArray = Split(strName, vbcrlf)
    strIDArray = Split(strID, vbcrlf)
    strUniqueList = Split(strUnique, vbcrlf)
    intTotal = 0
    ' Check Socket Designation
    For i = 0 To UBound(strNameArray) - 1
    intMark = 1
    ' Check for Redundancies
    For j = i + 1 To UBound(strNameArray) - 1
    If strNameArray(i) = strNameArray(j) Then
    intMark = 0
    End If
    Next
    ' If Redundant Unique ID's Exist
    For j = i + 1 To UBound(strNameArray) - 1
    If strUniqueList(i) <> "" And strUniqueList(j) <> "" And _
    (strUniqueList(i) <> strUniqueList(j)) Then
    intMark = 1
    End If
    Next
    ' Check for NULL ProcessorID
    If Trim(strIDArray(i)) = "0000000000000000" Then
    intMark = 0
    End If
    ' Calculate Total
    If intMark = 1 Then
    intTotal = intTotal + intMark
    End If
    Next
    ' Compare Results
    If intProc = 2 * intTotal Then
    GetHTStatus = "True"
    Else
    GetHTStatus = "False"
    End If
    End Function
    ' Get Memory Breakdown
    Function MemoryBreakdown
    Set colPMAItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemoryArray",,48)
    For Each objPMAItem in colPMAItems
    lngMax = CLng(objPMAItem.MaxCapacity)
    intCount = CInt(objPMAItem.MemoryDevices)
    Next
    ReDim Preserve strPMArray(intCount)
    Set colPMItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemory",,48)
    For Each objPMItem in colPMItems
    strValue = strValue & objPMItem.DeviceLocator & ": "
    strValue = strValue & objPMItem.Capacity / 2^20 & "MB, "
    strValue = strValue & objPMItem.Speed & "MHz"
    strPMArray(TrimTrailingNumber(objPMItem.Tag)) = strValue
    strValue = ""
    Next
    j = 0
    strResult = ""
    For j = 0 To intCount - 1
    If Trim(strPMArray(j)) = "" Then strPMArray(j) = "<Empty>"
    strResult = strResult & strPMArray(j) & vbcrlf
    Next
    strResult = strResult & (lngMax / 2^10) & "MB"
    MemoryBreakdown = strResult
    End Function
    ' Get Part Name
    Function ExtractPartName(strName)
    Dim chrRead
    Dim strRead
    Dim i
    For i = 2 To Len(strName)
    chrRead = Mid(strName, Len(strName) - (i - 1), 1)
    If chrRead <> Chr(34) Then
    strRead = chrRead & strRead
    Else
    Exit For
    End If
    Next
    ExtractPartName = strRead
    End Function
    ' Get Trailing Number
    Function TrimTrailingNumber(strNum)
    Dim chrRead
    Dim strRead
    Dim intLen
    strNum = Trim(strNum)
    intLen = Len(strNum)
    i = 1
    For i = 1 To intLen
    chrRead = Mid(strNum, intLen - (i - 1), 1)
    If IsNumeric(chrRead) = "True" Then
    strRead = chrRead & strRead
    Else
    Exit For
    End If
    Next
    TrimTrailingNumber = strRead
    End Function
    ' Function: WMIDateStringToDate(dtmDate)
    Function WMIDateToString(dtmDate)
    WMIDateToString = CDate(Mid(dtmDate, 5, 2) & "/" & _
    Mid(dtmDate, 7, 2) & "/" & _
    Left(dtmDate, 4) & " " & _
    Mid(dtmDate, 9, 2) & ":" & _
    Mid(dtmDate, 11, 2) & ":" & _
    Mid(dtmDate, 13, 2))
    End Function
    ' Function: GetOsVer
    Function GetOsVer
    Set colOperatingSystems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")
    For Each objOperatingSystem In colOperatingSystems
    GetOSVer = CSng(Left(objOperatingSystem.Version, 3))
    Next
    End Function
    ' Function: GetHPArray
    Function GetHPArray(strComputer2, strUsername2, strPassword2)
    ' Check for 64-bit Windows
    If InStr(PUBOSVer, "x64") Then
    strCompaq = "Program Files (x86)\Compaq\Cpqacuxe\Bin"
    Else
    strCompaq = "Program Files\Compaq\Cpqacuxe\Bin"
    End If
    ' Create Connection Object
    Set objWMIServiceRem = objWMIService.Get("Win32_Process")
    ' Confirm Location of Compaq Array Manager
    Set objHPShell = CreateObject("WScript.Shell")
    Set objHPFSO = CreateObject("Scripting.FileSystemObject")
    Set WshNetwork2 = WScript.CreateObject("WScript.Network")
    WshNetwork2.MapNetworkDrive "", "\\" & strComputer2 & "\C$" ,,strUsername2, strPassword2
    strProgram = "\\" & strComputer2 & "\C$\" & strCompaq & "\cpqacuxe.exe"
    ' Ensure Access is Possible
    If objHPFSO.FileExists(strProgram) Then
    ' Process Array Config
    strProcess = Chr(34) & "C:\" & strCompaq & "\cpqacuxe.exe" & Chr(34) & " -c c:\output.txt"
    Process = objWMIServiceRem.Create(strProcess, null, null, intProcessID)
    ' Check for "output.txt"
    For intTimerHP = 0 To 10
    If objFSO.FileExists("\\" & strComputer2 & "\C$\output.txt") Then
    Exit For
    Else
    WScript.Sleep(1000)
    End If
    Next
    ' Process Output
    If intTimerHP < 10 Then
    ' Check for Locked Output File
    Set objHPOutputFile = objHPFSO.GetFile("\\" & strComputer2 & "\C$\output.txt")
    If objHPOutputFile.Size <> 0 Then
    ' Close File
    Set objHPOutputFile = Nothing
    ' Continue Processesing File
    Set objHPInputFile = objHPFSO.OpenTextFile("\\" & strComputer2 & "\C$\output.txt", ForReading)
    Do Until objHPInputFile.AtEndOfStream
    strHPArray = strHPArray & objHPInputFile.ReadLine & vbcrlf
    Loop
    ' Close Input File
    objHPInputFile.Close
    ' Close Link to Server
    objHPFSO.DeleteFile("\\" & strComputer2 & "\C$\output.txt")
    Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
    Do While (objGetHPArray.Status = 0)
    WScript.Sleep(500)
    Loop
    ' Create String Array
    strHPParse = Split(strHPArray, vbcrlf)
    ' Parse For Individual RAID Arrays
    Dim strArrayList()
    z = 0
    For i = 0 To UBound(strHPParse)
    j = 0
    ' Array and Drives
    If InStr(strHPParse(i), "Array Specifications") Then
    ReDim Preserve strArrayList(z)
    strArrayList(z) = strArrayList(z) & strHPParse(i) & vbcrlf
    For j = i + 1 To Ubound(strHPParse)
    If InStr(strHPParse(j), "Array Specifications") Then
    Exit For
    Else
    strArrayList(z) = strArrayList(z) & strHPParse(j) & vbcrlf
    End If
    Next
    z = z + 1
    End If
    Next
    ' Process Each RAID Array
    x = 0
    For x = 0 To UBound(strArrayList)
    strListParse = Split(strArrayList(x), vbcrlf)
    For y = 0 To UBound(strListParse)
    ' Drives
    If Left(strListParse(y), 6) = "Drive=" Then
    strDrives = ""
    strDrives = Split(strListParse(y), ",")
    k = 0
    For j = 0 To UBound(strDrives)
    k = k + 1
    Next
    strDriveCount = k ' For Output
    End If
    ' Hot Spare
    If InStr(strListParse(y), "OnlineSpare=") Then
    If InStr(strListParse(y), "OnlineSpare= No") Then
    strHotSpare = strHotSpare & "N" ' For Output
    Else
    strHotSpare = strHotSpare & "Y" ' For Output
    End If
    End If
    ' Logical Drives
    If InStr(strListParse(y), "Logical Drive Specifications") Then
    ' Find First Logical Drive
    strRAID = Split(strListParse(y + 2), " ")
    strRAIDResult = strRAIDResult & "RAID " & strRAID(1) & " / " ' For Output
    strGetDrive = Split(strListParse(y + 3), " ")
    strRAIDSize = strRAIDSize & ByteConvertRAID(strGetDrive(1)) & " / " ' For Output
    End If
    Next
    ' Process Results
    strRAIDSize = Left(strRAIDSize, Len(strRAIDSize) - 3)
    strRAIDResult = Left(strRAIDResult, Len(strRAIDResult) - 3)
    strNewList = strNewList & strDriveCount & _
    ":" & strRAIDSize & ":" & strRAIDResult & ":" & strHotSpare & Chr(13)
    ' Dispose Array Variables
    strDriveCount = ""
    strRAIDSize = ""
    strRAIDResult = ""
    strHotSpare = ""
    Next
    ' Return Array Output
    GetHPArray = Left(strNewList, Len(strNewList) - 1)
    Exit Function
    Else ' "output.txt" Is Locked
    ' Close File
    Set objHPOutputFile = Nothing
    ' Kill Remote Connection
    Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
    Do While (objGetHPArray.Status = 0)
    WScript.Sleep(500)
    Loop
    GetHPArray = ""
    Exit Function
    End If
    Else ' "output.txt" Does not Exist
    ' Kill Remote Connection
    Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
    Do While (objGetHPArray.Status = 0)
    WScript.Sleep(500)
    Loop
    GetHPArray = ""
    Exit Function
    End If
    Else ' "Array Manager Does not Exist
    ' Input not Available
    Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
    Do While (objGetHPArray.Status = 0)
    WScript.Sleep(500)
    Loop
    GetHPArray = ""
    Exit Function
    End If
    End Function
    '--------------------Functions (End)--------------------'
    ' Set Excel Attributes
    Const xlVAlignTop = -4160
    Set objRange2 = objWorksheet.UsedRange
    objRange2.VerticalAlignment = xlVAlignTop
    ' Set Font Attributes
    objXLA.Cells.Font.Size = 8
    objXLA.Cells.Font.Name = "Arial"
    objXLA.Cells.Font.ColorIndex = 11
    objXLA.Cells.EntireColumn.AutoFit
    objXLA.Cells(1, 9).ColumnWidth = 30 ' RAM Slots
    objXLA.Cells(1, 11).ColumnWidth = 40 ' NIC Port
    objXLA.Cells(1, 13).ColumnWidth = 25 ' Connection Name
    objXLA.Cells(1, 14).ColumnWidth = 25 ' Interface IP's
    objXLA.Cells(1, 15).ColumnWidth = 25 ' Virtual IP's
    objXLA.Cells(1, 16).ColumnWidth = 15 ' DNS1
    objXLA.Cells(1, 17).ColumnWidth = 15 ' DNS2
    objXLA.Cells(1, 18).ColumnWidth = 15 ' Interface Type
    objXLA.Cells.HorizontalAlignment = 2 ' Drive Count
    objXLA.Cells(1, 20).ColumnWidth = 20 ' Virtual IP's
    objXLA.Cells(1, 21).ColumnWidth = 20 ' Virtual IP's
    ' Save
    set objFSO2 = CreateObject("Scripting.FileSystemObject")
    strFileName = objFSO2.getAbsolutePathName("") & "\Scan Results.xls"
    objWorkbook.SaveAs(strFileName)
    objWorkbook.Close
    objXLA.Quit
    ' Notify User
    WScript.Echo "Process Completed (" & Now & ")"
    ' Close Program
    WScript.Quit(0)

Maybe you are looking for

  • Alt+mnemonic key is not working properly for Menu Items

    Assume there are two menus , File Menu with mnemonic Alt+F and Save Menu with mnemonic Alt+S. File Menu contains the menu items like PageSetup with Mnemonic S. Save menu has the menu item Properties with Mnemonic P. Pressing Alt+F opens the File Menu

  • Error starting analytics - OBIEE 11.1.1.6 on Windows 7 64bit

    Hello All - I installed OBIEE 11.1.1.6 on Windows 7 64bit with out any errors. I am facing problem starting up the analytic's page, It is struck at the 500 Internal server error page. I opened up the enterprise manager to check whether all the servic

  • Missing master files / Version-0.apversion

    Greetings, i have an inexplicable error in Aperture 3. I have migrated my photo library into aperture and allowed it to "ingest" the photos. Prior to this, i was using the browser/finder as the interface of choice for managing my files. Now aperture

  • TDS Amount Change

    Hi Gurus, My client has a vendor.For That particular vendor he wants to change the TDS rates.For Example: If the total invoices of the vendor is Less than 30 lakhs then the TDS rate should be 0.5%.till now it is going like that.But the total invoices

  • SM:EXEC SERVICES JOB CANCELLED  with MESSAGE_TYPE_X  dump

    In SAP solution manager server  SM:EXEC SERVICES  job is Cancelling Hence we are unbale to get the EWA reports... Error: Job started Step 001 started (program RDSMOPBACK_AUTOSESSIONS, variant &0000000001009, user ID RAOP) Solution OC Application Moni