Disconnect the target iSCSI via the script?

Someone knows a way to script (or command line) a (deletion) offset of an iSCSI target?

Here's how to turn that function:

function RemoveIScsiTarget ($vmHostList, $address, $port) {
        foreach ($vmHost in $vmHostList) {
          $storageSystem =  $vmHost | Get-VMHostStorage | Get-View
          $storageSystem.UpdateViewData("storageDeviceInfo.hostBusAdapter")
          $iScsiDevice = "vmhba33"
          $iScsi = $storageSystem.StorageDeviceInfo.HostBusAdapter | where { $_.GetType().Name -eq "HostInternetScsiHba" }
          $sendTarget = $iScsi | foreach { $_.ConfiguredSendTarget } | where { $_.Address -like $address -and $_.Port -like $port }
          $sendTarget = $iScsi | foreach { $_.ConfiguredStaticTarget  } | where { $_.Address -like $address -and $_.Port -like $port }

          if ($sendTargets -ne $null -and $sendTargets.Count -gt 0) {
               $storageSystem.RemoveInternetScsiSendTargets($iScsiDevice, $sendTarget)
          }
          if ($staticTargets -ne $null -and $staticTargets.Count -gt 0) {
               $storageSystem.RemoveInternetScsiStaticTargets($iScsiDevice, $staticTarget)
          }
     }
}

And here is an example how to remove iScsi targets all hosts in your VC:

RemoveIScsiTarget (Get-VMHost) "10.10.10.*" "*"

Tags: VMware

Similar Questions

  • Sort by name via the script

    Hello world

    I would be grateful if someone could give some clues to sort by name from the

    Paragraph Styles, character Styles, Styles of object and panels color chart

    via the script.

    Thank you in advance.

    Edson Furman

    [email protected]

    To sort the styles I used the script below - works in CS3 and CS4 if it has been awhile since I finally tried. It could be coded with more elegance, but it worked well as it is. He does not account groups of style: I don't know what happens if your documents contain a sort you would better try.

    As for shades, these are not so easy to sort. There was a discussion about this at one of these sites:

    http://www.Hilfdirselbst.ch/gforum/gforum.cgi?jump=Forum%3d4

    http://InDesign-FAQ.de/

    Peter

    #target indesign
    
    sort_par_styles (app.documents[0]);
    sort_char_styles (app.documents[0]);
    sort_obj_styles (app.documents[0]);
    
    //-------------------------------------------------------------------------------
    
    function sort_par_styles (doc)
        {
        var string_array = sort_par_names (doc);
        for (var i = 0; i < string_array.length; i++)
            doc.paragraphStyles.item (string_array[i]).move (
                LocationOptions.after, doc.paragraphStyles[i+2])
        }
    
    function sort_par_names (doc)
      {
      var array = doc.paragraphStyles.everyItem().name;
      array.shift (); array.shift ();  // exclude [No p.] and [Basic p/]
      return array.sort (case_insensitive);
      }
    
    //-------------------------------------------------------------------------------
    
    function sort_char_styles (doc)
        {
        var string_array = sort_char_names (doc);
        for (var i = 0; i < string_array.length; i++)
            doc.characterStyles.item (string_array[i]).move (
                LocationOptions.after, doc.characterStyles[i+1])
        }
    
    function sort_char_names (doc)
      {
      var array = doc.characterStyles.everyItem().name;
      array.shift ();  // exclude [None]
      return array.sort (case_insensitive);
      }
    
    //-------------------------------------------------------------------------------
    
    function sort_obj_styles (doc)
        {
        var string_array = sort_obj_names (doc);
        for (var i = 0; i < string_array.length; i++)
            doc.objectStyles.item (string_array[i]).move (
                LocationOptions.after, doc.objectStyles[i+4])
        }
    
    function sort_obj_names (doc)
      {
      var array = doc.objectStyles.everyItem().name;
      array.shift (); array.shift (); array.shift ();  array.shift (); // exclude  [None], [Basic Graphics Frame], [Basic Text Frame], [Basic Grid]
      return array.sort (case_insensitive);
      }
    
    //-------------------------------------------------------------------------------
    
    function case_insensitive (a, b)
      {
      return a.toLowerCase() > b.toLowerCase()
      }
    
  • load via the script use

    Hello

    How can I charge a use (*.uri) via the script? Check the plug current if the plug-in is already loaded?

    Greetings,

    Martin

    Hi Martin

    The following will let you know what is the revision of a pluggin of data.

    The second function updates the plugin data upon request.

    Enjoy!

    Paul

    ' Gets the version of a use

    function GetDatapluginVersion (strDatapluginName)

    Dim oMyDataPlugin

    Set oMyDataPlugin = Navigator.Settings.RegisteredDataPlugins (strDatapluginName)

    GetDatapluginVersion = oMyDataPlugin.Version

    "Call the MsgBoxDisp (oMyDataPlugin.Version)."

    EndFunction

    Sub CheckUpdateAOP5

    Dim strAOP5CurrentVersion, strAOP5LatestVersion

    Dim MyVar

    protected path2AOP5: Path2AOP5 = 'Yours to fill. "

    strAOP5CurrentVersion = GetDatapluginVersion ("AOP5")

    strAOP5LatestVersion = "11.0.1f5081".

    If strAOP5CurrentVersion = strAOP5LatestVersion then

    ' msgbox ("AOP5 latest version:" & strAOP5LatestVersion & "is equivalent to" & strAOP5CurrentVersion)

    on the other

    MyVar = MsgBox ("AOP5 use requires an update now?", vbYesNo + vbQuestion, "DIAdem")

    Select if MyVar

    Case VbYes

    Call ExtProgram (Path2AOP5)

    Select end

    end if

    EndSub

  • Disconnect the cable in a VI script

    How to disconnect the wire between two terminals in a VI script?

    Get a reference to the thread and call the Delete method. If the wire is connected to multiple receivers, you can get references to the source and (other sinks), remove the wire, then reconnect to all receivers other than the one you want to disconnect.

  • Patch Vista - launch of the patches via the script

    I search for an answer online for days and finally gave up and decided to post here...

    I'm currently launching spots on our handful of machines Vista here via a script.  Each time, it returns the error "attempt to reference a token that does not exist.

    I tried to start by calling directly from the server, copy locally, mapping a drive to the server for the launch, etc... any attempt gives me this error even.  What happened to the multiple patches as well.

    Someone at - he seen elsewhere or have any ideas?

    UnderdogRC

    Thank you for visiting the website of Microsoft Windows Vista Community. The question you have posted is related to the server and would be better suited to the Technet community. Please visit the link below to find a community that will provide the support you want.

    http://TechNet.Microsoft.com/en-us/default.aspx Engineer Support Justin M. Microsoft Answers visit our Microsoft answers feedback Forumand let us know what you think.

  • Get and Set of dynamic Type via the Script output

    I am running vRO 6.0.1. I built a dynamic type to Veeam. I can see the items in the inventory and can select them as attributes in workflows. I'm looking to get the dynamic Type via a script object and set it as a variable in the script output, but its does not work. I created the dynamic type using the type dynamic plug-in generator v2.

    I have 'Veeam' namespace with types:

    VeeamHost

    jobFolder

    job

    I put an output with the 'DynamicTypes:Veeam.job' type attribute and the name jobOut

    My script is just:

    jobOut = Server.findForType ('DynamicTypes:Veeam.job' '29714267-f517-4f76-a621-902b3e789772/urn:veeam:Job:26eddcda-ea52-469b-b4c9-0b80fec098ae');

    System.log ("Job found:" + jobOut "'); 

    After the execution of the jobOut variable is empty. In the newspapers, I see:

    Found job: DynamicWrapper (Instance): [DynamicTypesDynamicObject]-[class com.vmware.o11n.plugin.dynamictypes.model.DynamicObject] - VALUE: dynobj: [__ns:Veeam __id:29714267-f517-4f76-a621-902b3e789772/urn:veeam:Job:26eddcda-ea52-469b-b4c9-0b80fec098ae __tp:DynamicTypes:Veeam.job]

    Does anyone have an idea of how complete the release of DynamicTypes:Veeam.job with the actual work of veeam I got via the script?

    Could check you what happens if you replace the line

    jobOut = Server.findForType("DynamicTypes:Veeam.job","29714267-f517-4f76-a621-902b3e789772/urn:veeam:Job:26eddcda-ea52-469b-b4c9-0b80fec098ae");

    with

    jobOut is DynamicTypesManager.getObject ("Veeam", "task", "29714267-f517-4f76-a621-902b3e789772/urn:veeam:Job:26eddcda-ea52-469b-b4c9-0b80fec098ae");.

  • beforeSave "unable to delete the target of an active script event" error

    Hello

    Can someone get to work, the extract below?

    I can't get the beforeSave event to place an image, I get the error message "cannot delete the target of an active script event.

    The same question was asked and not answered here beforeSave "unable to delete the target of an active script event" error with a snippet of applescript.

    Thank you

    Trevor

    #targetengine placeImage
    before = function (evt) {
        var doc, placeFile, newPage;
        doc = evt.target;
        if ( !(doc instanceof Document) ) return;
        placeFile = new File (File.openDialog());
        if (!placeFile) return;
        try {
          newPage = doc.pages.add();
          placedImage = newPage.place(placeFile)[0];
        } catch (e) {
          app.eventListeners.item("onBeforeSave").isValid && app.eventListeners.item("onBeforeSave").remove();
          alert(e); //Cannot delete the target of an active script event" error
        }
    }
    
    
    function registerEventListener() {
      app.eventListeners.item("onBeforeSave").isValid && app.eventListeners.item("onBeforeSave").remove();
      app.eventListeners.add( "beforeSave", before).name = "onBeforeSave";
    }
    
    registerEventListener();
    
    
    #targetengine placeImage
    before = function (evt) {
        var doc, placeFile, temp, tempDoc;
        doc = evt.target;
        if ( !(doc instanceof Document) ) return;
        placeFile = new File (File.openDialog());
        if (!placeFile) return;
        evt.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
        try {
          tempDoc = app.documents.add(false);
          temp = tempDoc.spreads[0];
          placedImage = temp.place(placeFile)[0];
          temp.duplicate(LocationOptions.BEFORE, doc.spreads[0]);
          tempDoc.close(SaveOptions.NO);
        } catch (e) {
          app.eventListeners.item("onBeforeSave").isValid && app.eventListeners.item("onBeforeSave").remove();
          alert(e); //Cannot delete the target of an active script event" error
        }
    }
    
    function registerEventListener() {
      app.eventListeners.item("onBeforeSave").isValid && app.eventListeners.item("onBeforeSave").remove();
      app.eventListeners.add( "beforeSave", before).name = "onBeforeSave";
    }
    
    registerEventListener();
    

    Œuvres without raising an error.

  • rendering image via the script get me uknown messege

    Hi all 2, maybe someone knows and can help me, what means of alert message and why it showing on 2 of my 7 work computers (all PC's have after effects cs5 but why only on two display this message?), when I try to make the current image via my script. My script - rendered the current image in the png file (and at this point after effect a bug and adding numbers 00000 filename so I need to find my rendered file and fix bug of file name and import file back), so when I see this message my script does not work (AE render the file, but the incorrect file name and my script is unable to import it to AE)

    PS to make the current image I create my own preset (with hands) for the output module based on the png sequence

    error.PNG

    THX

    Hi guys, I understand, the problem in my script make part, first of all I have the code to save the current image

    myProj.renderQueue.item (1) .outputModule (1) mpfprojectdir\dev10\src\csharp\projectbase.file = File (DesktopPath + "\\temp\\" + "_" + myLayerName); and it gives me error, so I fixed this alert message by

    ("myProj.renderQueue.item (1) .outputModule (1) mpfprojectdir\dev10\src\csharp\projectbase.file = File(DesktopPath+"\\1111\\"+"ltp"+"_"+myLayerName+"[###].png ");

    [#] .png - it's a key, thx to all!

  • Precomposer new function AE CC via the script

    As we know new AE CC got awesome box called "Adjust duration of both extended the selected layer composition".

    The default setting in the script guide is:

    [object LayerCollection] .precompose (array, string, [bool]);


    But it does not work with a new checkbox.

    So how to operate with a new checkbox via the script?

    Thanks for reading.

    I found that precomp function does not work with app.project.activeItem.selectedLayers;

    So here's the finishing touch that works with selected layers.

    See you soon

    
    function precompLayer() {
    var myComp = app.project.activeItem;
    if(myComp == null){alert("Please, select your composition"); return false;}
    
       var selectLayers = app.project.activeItem.selectedLayers; // selected
       if(selectLayers.length <1 ){alert("Please, select layers"); return false;}
    
       myLayers = [];      // precomp function works only with layers indexes, so array should contain layers indexes
    
            for (var l = 0; l< selectLayers.length; l++){
                myLayers.push(selectLayers[l].index);            // new array with layers indexes
            }
    
     var precompIndices = myLayers;  //change this to customize
            var precompName = "new_comp";  //change this to customize
            var parentComp = app.project.activeItem;  //change this to customize
            clearOutput();
            writeLn("Creating precompose");
            app.beginUndoGroup("Precompose");
            var Inpoint = 0;
            var Outpoint = 0;
    
            var precomp = parentComp.layers.precompose(precompIndices, precompName, true);
            var adjustStartTime = precomp.duration, newCompDuration = 0;
            writeLn(precomp.layers.length+" layers in procompose");
    
            for(var i=1; i<=precomp.layers.length; i++) {
                var layer = precomp.layer(i);
    
                (Inpoint > layer.inPoint) ? Inpoint = layer.inPoint : Inpoint;                  // begin of precomp
                (Outpoint < layer.outPoint) ? Outpoint = layer.outPoint : Outpoint;       // end of precomp
    
                var duration = Outpoint - Inpoint;
                adjustStartTime = adjustStartTime > layer.inPoint ? layer.inPoint : adjustStartTime;
                newCompDuration = newCompDuration < duration? duration : newCompDuration;
            }
                writeLn("New duration = "+newCompDuration);
    
            for(var i=1; i<=precomp.layers.length; i++) {
                precomp.layer(i).startTime -= adjustStartTime;
            }
    
            precomp.duration = newCompDuration;
            parentComp.layer(precompName).startTime = adjustStartTime;
            app.endUndoGroup();
    
    writeLn("Done!");
    }
    precompLayer();
    
  • Is it possible to create a new file using the XML via java Script?

    Hello everyone,

    Is it possible to create a new file using the XML via java Script

    • I have xml information that need to use for file name, size.
    • Based on xml file we can create a new file in InDesign with java script?
    • Kindly help me if anyone has an idea about this.

    I use InDesign CS4 on windows 7

    Sample file is attached below.

    Kind regards

    Siva

    <UpdateAd>
    <AdId>3403699</AdId>
    <Width type="mm">91,79</Width>
    <Height type="mm">80,00</Height>
    <ProductionCategory>4</ProductionCategory>
    <BookedCCIColors>sw</BookedCCIColors>
    <WorkFlowType>PDF</WorkFlowType>
    <CustomerNumber>652224</CustomerNumber>
    <CustName1>Erich Prang</CustName1>
    <Description/>
    <Description2>R</Description2>
    <UpdateIns>
    <Titel>RHZ</Titel>
    <Publication>B2</Publication>
    <RunDate>26-07-2011</RunDate>
    <Zone>H30</Zone>
    <KDDATEN>nein</KDDATEN>
    </UpdateIns>
    <WorkflowStep>IR</WorkflowStep>
    <Proof>No</Proof>
    </UpdateAd>
    
    

    xml.png

    Try this:

    var f =File.openDialog ();
    f.open('r');
    var xml = new XML(f.read());
    f.close();
    
    var myDocument = app.documents.add();
    myDocument.documentPreferences.pageHeight = xml..Height+"mm";
    myDocument.documentPreferences.pageWidth = xml..Width+"mm";
    var rect = myDocument.pages[0].rectangles,add();
    rect.geometricBounds = myDocument.pages[0].bounds;
    rect.strokeAlignment = StrokeAlignment.INSIDE_ALIGNMENT;
    rect.strokeColor = myDocument.swatches.item("Black");
    rect.strokeWeight = 1;
    myDocument.save(File(f.path + "/" + xml..AdId + ".indd"))
    

    Substances

  • The value of PDF file printed via the script name

    Hi people!

    I have a little problem with the generation of a PDF file. First my Workflow:

    I have an InDesign document with 6 pages. This document is merged with a databasefile containing 100 records. After it is merged, we need to generate a PDF file. This PDF file is opened in acrobat. In the document, I am looking for one ID for each record so I can split the document to 100 files (each with 6 pages) and name by the ID that I found.

    The Acrobat script is finished and functional. I thought: the InDesign script is over, too. But I was wrong-. -.

    I merged the databasefile with the document and it has exported to PDF. But after export, we noticed that the Acrobat script isn't finding the adressheader where ID is in. The script only noticed the text after this header. The result is, as get-Acrobat always 'null' as ID

    If print us the PDF with our PDFprinter, the header could be read by our script of Acrobat. I don't know why this is... But now, I changed the script to print the files through our PDF printer. Unfortunately I can not set a name for my exported file - do you know if it is possible to print PDF files without asking for confirmation after each other as well as with a via script name?

    Here you can see the old writing for InDesign and after her, the sript Acrobat. Maybe I made a mistake by generating my PDFexport and have no need to use the printer?

    INDESIGN SCRIPT:

    /**
    * invite filebrowser and stores the name and path of the file in variable
    */
    var sourceDocument = File.openDialog ("Bitte Indesign-Dokument Park", "*.indd", false);

    /**
    * stores the only prefix of file name to use as the new file name
    */
    newName var = sourceDocument.name.substr (0, sourceDocument.name.length - 5);

    /**
    stores in folder where the file is stored
    */
    var dbSourceFolder = sourceDocument.parent + "/"; "

    /**
    * guests for databasefile, where production is expected to begin
    */
    var dbstartfile = File.openDialog ("Start-Datenbankdatei of Bitte Park", "*.txt", false);

    /**
    * Gets databasefile basename
    */
    var dbstartfilename = dbstartfile.name.slice (0, dbstartfile.name.search(/_Teil+/));

    /**
    * Gets number of first databasefile
    */
    var i = dbstartfile.name.slice (dbstartfile.name.search(/_Teil+/) + 5) .slice (0, -4);

    /**
    * generates the path and name of the first databasefile to use
    */
    var dbSource = dbstartfile;

    /**
    * set PDF preset to generate PDFS
    */
    var PDFPreset = app.pdfExportPresets.item ("GAG - PDF");

    /**
    * stop throwing alerts
    */
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

    message will be thrown if databasefile is not existing
    If (dbSource.exists == false) {}
    reboot to launch alerts
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
    Alert ("File" + dbSourceFolder + dbprefix + "_Teil" + i + ".txt konnte nicht werden found! \n\rBitte starten Sie den procedure Rubis und Sie die right Datenbankdatei one enter.");
    }
    another process begins
    else {}
    even if (dbSource.exists == true) {}
    Opens the document indesign source without displaying
    mergeDocument = app.open (File (sourceDocument), false);
    defines what databasefile should be used for data merging
    mergeDocument.dataMergeProperties.selectDataSource (File (dbSource));
    starts the file database and the indesign document merging
    mergeDocument.dataMergeProperties.mergeRecords ();
    document generated in PDF export
    app.activeDocument.exportFile (ExportFormat.pdfType, File(sourceDocument.parent+"/"+newName+"_Teil"+i+".pdf"), false, PDFPreset);
    farm open indesign document
    mergeDocument.close (SaveOptions.no);
    i ++ ;

    change the name of the database file to get the next file
    dbSource = File(dbSource.parent+"/"+dbstartfilename+"_Teil"+i+".txt");
    }
    }
    reboot to launch alerts
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
    Alert ("PDF-Generierung sky!");

    SCRIPT ACROBAT:


    /**
    * Path where files should be saved
    * Special characters like spaces must be preceded of--------.
    * If you want to change the folder, use the following form:
    * ' / DriveLetter/foldername /... /LastFolderName/.
    * Be careful not to forget the / before and after the location
    */
    filepath var = "/ c/pdf_split_test / ';

    /**
    * Number of display pages - do not hesitate to change
    */

    pageType = app.prompt var ("Please die Seitenzahl der presentations one gewunschte.", "");
    Alert (PAGETYPE);

    /**
    to search for regular expression
    */

    var idNumber = / 08\d\d\d\d\-\d\d\d\-\d\d\d\d\d-\d\d\d-\d\d/g;

    /**
    * If possible this function gets the number sought as string
    *
    @param string of revenge that is to be found in the document
    * @return null if rematch is not found or a string if the rematch is
    */

    function ExtractFromDocument (reMatch) {}
    try {}
    var Out = new Object();
    for (var i = 0; i < 1; i ++)
    {
    numWords = this.getPageNumWords (i);
    var PageText = ' ';
    for (var j = 0; j < 30; j ++) {}
    var Word = this.getPageNthWord (i, j, false);
    PageText += Word;
    }
    var strMatches = PageText.match (reMatch);
    If (strMatches == null) continue;
    }
    Return strMatches;
    } catch (e)
    {
    App.Alert ("processing error:" + e)
    }
    }

    /**
    * tries to load given filename (excerpt number)
    *
    @param string file name of the file that should be checked
    @param n number of iterate when checking files
    * @return true if the file exists or false otherwise
    */

    function checkIfFileExists (filename, n) {}
    var existingDoc = false;
    try {}
    If (n == 0) {}
    var checkDoc = app.openDoc(filepath+filename+"-000.pdf");
    } else {}
    var checkDoc = app.openDoc(filepath+filename+"-000_"+n+".pdf");
    }
    checkDoc.closeDoc ();
    existingDoc = true;
    } catch (e) {}
    }
    If (existingDoc == true) {}
    n = n + 1;
    n = checkIfFileExists (filename, n);
    }
    return n;
    }

    var pageAmount = this.numPages;
    for (i = 0; I < pageAmount; i + pageType) {}
    var filename = ExtractFromDocument (idNumber);
    fileExistence = checkIfFileExists (filename, 0);
    If (fileExistence! = 0) {}

    this.extractPages ({nEnd:(pageType-1), cPath: filepath + filename + "-000_" + fileExistence + ".pdf"});
    } else {}
    this.extractPages ({nEnd:(pageType-1), cPath: filepath + filename + ""-000.pdf ""});
    }
    this.deletePages ({nStart:0, nEnd: pageType-1});
    }

    Hello

    I have a little problem with the generation of a PDF file. First my Workflow:

    I have an InDesign document with 6 pages. This document is merged with a databasefile containing 100 records. After it is merged, we need to generate a PDF file. This PDF file is opened in acrobat. In the document, I am looking for one ID for each record so I can split the document to 100 files (each with 6 pages) and name by the ID that I found.

    Why you are not exporting 6 pages PDF directly from InDesign?

    Robin

    www.adobescripts.co.UK

  • Try to set / change the password BIOS admin via the script WMI on ThinkStation D20

    Hello Lenovo Community!

    Start using the WMI Lenovo_SetBiosSetting class on a D20 system.

    If I understand the documentation that there is a limitation on the BIOS password in the past, but I updated to the latest BIOS Rev who support States was added for this feature.

    I use a script that changes the supervisor on computers password successfully thinkpad, but when even to run the script from command line on the D20 system it returns "SUCCESS" however to change the password did not effect!

    I'm using the right parameters are the standard of lenovo

    ' pap, oldpass newpass, ascii, we.

    I thought maybe "pap" is not the correct setting for password Admin on the D20, however the WMI available, posted 2010 guide, does not show otherwise.

    Someone at - it an example script that they can display successfully change the password on a D20 system?

    Please and thx!

    Did you run the SaveSetting script after changing the password?

    You can get the SaveSetting script from the sample scripts D20 located at the following link:

    http://support.Lenovo.com/en_US/downloads/detail.page?docid=UM002033

    You can use the script SetAdminPassword from the library of scripts of series E, then a follow-up that with something like what follows before restarting:

    "cscript SaveSetting.vbs" originalpwd, ascii, we.

    Replace 'originalpwd' with all what your existing password was at the time wherever you booted the system.

  • NIC impossible printer in Windows 7 Via VB script in the Windows 2003 domain controller

    I have been using the following script to add printers to network shared for users.

    The script worked great with XP machines but on Windows 7, the printers are not map.

    The dose of script to be run, the UAC is disabled on windows computers 7

    The script I use is:

    ' Printers.vbs - Windows Logon Script.

    Set objNetwork = CreateObject

    objNetwork.AddWindowsPrinterConnection "name\printer name".

    objNetwork.AddWindowsPrinterConnection "name\printer name".

    objNetwork.AddWindowsPrinterConnection "name\printer name".

    Any help would be appricated.

    Thansks

    Hi Juliet,

    Thanks for posting your question in the Microsoft Community.

     

    The question you posted would be better suited in the TechNet Forums.

    I would recommend posting your query from the link:

     

    http://social.technet.Microsoft.com/forums/scriptcenter/en-us/home

    I hope that the information above helps you.

  • Apply the shift via the script

    Hello

    from Toon Boom, I have many animations frame by frame vectored in the form of PDF files that need to be converted to SVG.

    Using an Illustrator script I found on the web, it is no big deal.

    This is the script:

    /**********************************************************
    
    
    ADOBE SYSTEMS INCORPORATED 
    Copyright 2005-2010 Adobe Systems Incorporated 
    All Rights Reserved 
    
    
    NOTICE:  Adobe permits you to use, modify, and 
    distribute this file in accordance with the terms
    of the Adobe license agreement accompanying it.  
    If you have received this file from a source 
    other than Adobe, then your use, modification,
    or distribution of it requires the prior 
    written permission of Adobe. 
    
    
    *********************************************************/
    
    
    /**********************************************************
    
    Save as SVGs.jsx
    
    
    DESCRIPTION
    
    
    This sample gets files specified by the user from the 
    selected folder and batch processes them and saves them 
    as SVGs in the user desired destination with the same 
    file name.
    
    
    Based on Adobe's "Save as PDFs" sample script, intended for Illustrator CS6
    
    **********************************************************/
    
    
    // Main Code [Execution of script begins here]
    
    
    // uncomment to suppress Illustrator warning dialogs
    // app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
    
    
    var destFolder, sourceFolder, files, fileType, sourceDoc, targetFile, svgSaveOpts;
    
    
    // Select the source folder.
    sourceFolder = Folder.selectDialog( 'Select the folder with Illustrator files you want to convert to SVG', '~' );
    
    
    // If a valid folder is selected
    if ( sourceFolder != null )
    {
      files = new Array();
      fileType = prompt( 'Select type of Illustrator files to you want to process. Eg: *.ai', '*.pdf' );
    
      // Get all files matching the pattern
      files = sourceFolder.getFiles( fileType );
    
      if ( files.length > 0 )
      {
      // Get the destination to save the files
      destFolder = sourceFolder;
      for ( i = 0; i < files.length; i++ )
      {
      sourceDoc = app.open(files[i]); // returns the document object
    
      // Call function getNewName to get the name and file to save the SVG
      targetFile = getNewName();
    
      // Call function getSVGOptions get the SVGSaveOptions for the files
      svgSaveOpts = getSVGOptions( );
    
      // Save as svg
      sourceDoc.exportFile(targetFile, ExportType.SVG, svgSaveOpts );
    
    
      sourceDoc.close();
      }
      alert( 'Files are saved as SVG in ' + destFolder );
      }
      else
      {
      alert( 'No matching files found' );
      }
    }
    
    
    
    
    /*********************************************************
    
    
    getNewName: Function to get the new file name. The primary
    name is the same as the source file.
    
    
    **********************************************************/
    
    
    function getNewName()
    {
      var ext, docName, newName, saveInFile, docName;
      docName = sourceDoc.name;
      ext = '.svg'; // new extension for svg file
      newName = "";
    
      for ( var i = 0 ; docName[i] != "." ; i++ )
      {
      newName += docName[i];
      }
      newName += ext; // full svg name of the file
    
      // Create a file object to save the svg
      saveInFile = new File( destFolder + '/' + newName );
    
    
    
      return saveInFile;
    }
    
    
    
    
    function getSVGOptions()
    {
      var svgSaveOpts = new ExportOptionsSVG();
    
    
      //just using defaults aside from what's written below
      //see http://cssdk.host.adobe.com/sdk/1.0/docs/WebHelp/references/csawlib/com/adobe/illustrator/ExportOptionsSVG.html
    
      svgSaveOpts.embedRasterImages = true;
    
      return svgSaveOpts;
    }
    

    Due to some other issues, I am currently for any compensation my graphics using the object > path > offset in Illustrator and assigning a value of 0.001 mm.

    I thought that it is the simplest solution, and after that, the graphics are perfectly fine.

    The problem is that it is not only a few simple graphics, but animations with often more than 200 images (which would mean 200 PDF files to edit).

    It manually all would be almost impossible.

    So I'm wondering if there isn't a way to add the offset command to the script, so all of my PDF files have been applied all offset by being converted into SVG.

    Would it be possible (I'm really hoping so)?

    I just need a way to automate that. An action recording can be useful for some images, but I think rather in a batch operation.

    Thank you!

    but you can use actions on a lot!

    Use the 'batch' option in the drop down palette menu actions. It allows you to perform an action on a folder of files.

  • When you run the script via VMware tools when power changed, some commands in script (as a copy) has failed.

    I came across a very strange question. I tried to create some custom vmware scripting tools, such as a new .bat file. This file contains a large number of orders, mostly as copy command "copy file://\\192.168.172.5\abc.exe c:\. ». I set this file as a custom script for Script event - power on guest operating system. Everything goes well with the bat file when I tested it. But after that I changed the State of power to power on, all other commands work fine except the copy commands in the bat file. Why? How can I make it work? Of course the problem of network. And that makes me very confused.

    Hello

    First copy the files on local disk was OK.

    If this works for local disk, but not to a network drive, then hit you indeed a permissions issue any.

    But if I run the script with tools VMware service script, the commands of copy (of the remote shared folder) failed while other controls worked well. I'm quite confused.

    In fact, it is easily explained. The VMware tools service (Yes, it's a service) runs under the account Local system and by default, the local system account has no access to the network for security reasons. You can change the user of the service runs under and see if that solves your problem (very likely)

    To do this, go to computer management (right-click icon desktop, select 'Manage') and open Services and Applications, service page, locate the VMware Tools service in the list. Select properties, log on to the page tabs and change account at your own Local System account. Restart the service and it should work.

    --

    Wil

    _____________________________________________________

    Visit the new VMware developers at http://www.vi-toolkit.com wiki

Maybe you are looking for

  • Satellite C650-107 - CPU Upgrade

    Hello I have the opportunity to acquire a new processor which should be compatible with the support of motherboard of the laptop, but I wonder if it will work even on the laptop. Computer laptop is Toshiba Satellite C650-107, it comes originally with

  • P70 rooted - uninstall Lenovo Security?

    Hi, is it possible we can completely uninstall Lenovo P70's safety? I already rooted my phone and uninstalled, but once that I reboot or restart my phone, he is back or reinstalled itself. How can I remove this completely? No its use since the antivi

  • Windows PowerShell ISE is required on Windows Vista Home Edition?

    Windows PowerShell ISE is required on Windows Vista Home Edition? Original title: Windows PowerShell ISE

  • Without emergency address firewall failover

    Hello We have two ASA5525 in failover mode. Only their IP address configuration a. For example: ! interface GigabitEthernet0/0Outside descriptionnameif outsidesecurity-level 0IP 71.210.56.231 255.255.255.252!interface GigabitEthernet0/1Description DM

  • OBIEE analytics on Chrome

    Hi allWhy no analytical obiee render perfectly in chrome? Is there a specific reason for it. I am facing a problem with a command prompt that is invited from a prompt on the other. It works perfectly in Firefox.Thanks in advanceConcerningIpog