Need to use variable Local Paths

Hello,
I have a the following snippit, how can I add a variable to the bolded UNC path C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\gpreport.xml
Those paths will change a lot in my scenerio. Thank you.
$file_server = Read-Host "Enter the file server IP address"
(Get-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\gpreport.xml") | ForEach-Object { $_ -replace "99.999.999.999", "$file_server" } | Set-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\gpreport.xml"
(Get-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\Backup.xml") | ForEach-Object { $_ -replace "99.999.999.999", "$file_server" } | Set-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\Backup.xml"
(Get-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\DomainSysvol\GPO\User\Documents & Settings\fdeploy1.ini") | ForEach-Object { $_ -replace "99.999.999.999", "$file_server" } | Set-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\DomainSysvol\GPO\User\Documents & Settings\fdeploy1.ini"
(Get-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\DomainSysvol\GPO\User\Preferences\Drives\drives.xml") | ForEach-Object { $_ -replace "\\99.999.999.999", "\\$file_server" } | Set-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\DomainSysvol\GPO\User\Preferences\Drives\drives.xml"
(Get-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\DomainSysvol\GPO\User\Preferences\files\files.xml") | ForEach-Object { $_ -replace "\\99.999.999.999", "\\$file_server" } | Set-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\DomainSysvol\GPO\User\Preferences\files\files.xml"

I'm not sure I understand the question. Are you saying you want the bold part of your path (currently hard-coded) to be in a variable instead? That would look something like this:
$file_server = Read-Host "Enter the file server IP address"
$guid = '{231A178D-DC6C-4186-9575-9C64F07DA5B5}'
(Get-Content "C:\TEMP\GPO\source\5\$guid\gpreport.xml") |
ForEach-Object { $_ -replace "99.999.999.999", "$file_server" } |
Set-Content "C:\TEMP\GPO\source\5\$guid\gpreport.xml"
(Get-Content "C:\TEMP\GPO\source\5\$guid\Backup.xml") |
ForEach-Object { $_ -replace "99.999.999.999", "$file_server" } |
Set-Content "C:\TEMP\GPO\source\5\$guid\Backup.xml"
(Get-Content "C:\TEMP\GPO\source\5\$guid\DomainSysvol\GPO\User\Documents & Settings\fdeploy1.ini") |
ForEach-Object { $_ -replace "99.999.999.999", "$file_server" } |
Set-Content "C:\TEMP\GPO\source\5\$guid\DomainSysvol\GPO\User\Documents & Settings\fdeploy1.ini"
(Get-Content "C:\TEMP\GPO\source\5\$guid\DomainSysvol\GPO\User\Preferences\Drives\drives.xml") |
ForEach-Object { $_ -replace "\\99.999.999.999", "\\$file_server" } |
Set-Content "C:\TEMP\GPO\source\5\$guid\DomainSysvol\GPO\User\Preferences\Drives\drives.xml"
(Get-Content "C:\TEMP\GPO\source\5\$guid\DomainSysvol\GPO\User\Preferences\files\files.xml") |
ForEach-Object { $_ -replace "\\99.999.999.999", "\\$file_server" } |
Set-Content "C:\TEMP\GPO\source\5\$guid\DomainSysvol\GPO\User\Preferences\files\files.xml"

Similar Messages

  • I need help using the target path tool

    Hi all,
    I realise that I need to keep all my code on the main timeline, so now I need some serious help with targeting movieclips and buttons, when I use the target path tool (the little gun sight in the action script panel) it lets me navigate to the thing I want, but when I use it's suggestion it very often doesn't work, and I am left using trial and error to work it out.  Ican get stuff to work, but I really have no idea why or how I am doing it, Sorry to be such a N00B, but I really think if I can work this out I am going to get somwhere.
    Cheers
    sub

    subtlefly72 wrote:
    Thanks kglad,
    OK that is basically what I have been doing, but its been a bit hit and miss, but maybe now I see why, your last sentence
    of course, all those objects have to exist at the time your code executes.
    So if I am referencing something inside a mc and it doesnt exist on the first frame there will be an error?
    exactly.
    also what is the       this.  Object() and Object(parent)  ??
    Do I need to be using these?
    not when using code on the main timeline.  "this" refers to the current scope which for code on the main timeline, is the main timeline.  the following are the same:
    this.mc and mc
    this.var1 and var1
    And still I want to know why the target tool gives me a path that doesn't work?
    i can't tell you much about the target tool.  i've never used it.  but i tried testing it just now and it seemed to work correctly to target a nested movieclip.  again, you must sure that object exists when your code executes so if you target something on frame 2 (or greater) of a movieclip using code on frame 1 of the main timeline, the reference may be correct but the object won't exist when your code executes.  there are a number of ways to handle that if it's your main problem.

  • Using Variable Replacement Path with Hierarchies

    Hi,
    I have a requirement where I have two product hierarchies.
    In my report I want the user to be able to select which hierarchy they view at run time.
    I want them to be able to see this hierarchy as a tree,in order for me to do this I first must inlcude one variable to specify which hierarchy i am going to use, then the next Variable2 is populated by Variable1 and allows the users to expand on that hierarchy tree.
    E.g
    At Run Time
    Selection 1: User selects Product Hierarchy1
    Selection 2: Gets automatically populated based on selection 1 to show the product hierarchy tree for this variable.
    I have tried using replacement paths to do this but it does not allow this.
    Any ideaS?
    Thanks

    It finally worked, looks like the reason it was not working was a Query Designer exception issue whihc went with a re-start of Query Designer.
    All good

  • Using variables in paths to objects

    Hi
    I'm wondering how I can use a string in a declared variable
    for a path to an object. Here's an example:
    On the press of a button a variable is declared:
    _root.nextsection = "news";
    And later on I want to use the string "news" in a path, like
    this (on a frame action):
    if (_root.nextsection == "news") {
    this.nextsection.gotoAndPlay(1);
    As you can see in the second line I'm using the variable name
    as a path... but this doesn't work.
    Any suggestions?
    Thanks

    Depending of where your if statement is, if your
    this.nextsection is the
    same as _root.nextsection, since this is a string and not an
    mc, what it
    does is:
    "news".gotoAndPlay(1).
    If you had a movieclip named news in the _root, then you
    could do:
    _root[_root.nextsection].gotoAndPlay(1) // EQUIVALENT TO
    _root["news"] or
    _root.news
    Other option is:
    var mynextsection_mc = eval("_root." + _root.nextsection) ;
    mynextsection_mc.gotoAndPlay(1);
    Flash will evaluate your constructed string "_root.news" to
    an object and
    return it, if it doesn't match anything, then you will get an
    undefined.
    JG
    "Cetrez" <[email protected]> wrote in
    message
    news:ejqacs$q6r$[email protected]..
    > Hi
    >
    > I'm wondering how I can use a string in a declared
    variable for a path to
    > an
    > object. Here's an example:
    >
    > On the press of a button a variable is declared:
    >
    > _root.nextsection = "news";
    >
    >
    >
    > And later on I want to use the string "news" in a path,
    like this (on a
    > frame
    > action):
    >
    > if (_root.nextsection == "news") {
    > this.nextsection.gotoAndPlay(1);
    >
    > }
    >
    > As you can see in the second line I'm using the variable
    name as a path...
    > but
    > this doesn't work.
    >
    > Any suggestions?
    > Thanks
    >

  • MM_openBrWindow - using variable in path

    Hello,
    If I have done this:
    <script language="javascript">
    var large="/graphics/00000001/main.jpg";
    </script>
    How would I write the MM_openBrWindow to use that variable?
    So normally it is like this:
    <a href="javascript:;" onClick="MM_openBrWindow
    ('imagepath','large','scrollbars=yes,resizable=yes,width=540,height=540')">
    View Large Image</a>
    Where 'imagepath' is a hardcoded path. How can I write it to
    interpret and
    use the variable "large" I defined above? Thank you

    <script type="text/javascript">document.write('<a
    href="javascript:;"
    onClick="window.open('imagepath'," + large
    +"','scrollbars=yes,resizable=yes,width=540,height=540')\">View
    Large
    Image</"+ 'a>'
    </script>
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Cortney" <[email protected]> wrote in message
    news:[email protected]..
    > Hello,
    >
    > If I have done this:
    >
    > <script language="javascript">
    > var large="/graphics/00000001/main.jpg";
    > </script>
    >
    > How would I write the MM_openBrWindow to use that
    variable?
    >
    > So normally it is like this:
    >
    > <a href="javascript:;" onClick="MM_openBrWindow
    >
    ('imagepath','large','scrollbars=yes,resizable=yes,width=540,height=540')">
    > View Large Image</a>
    >
    > Where 'imagepath' is a hardcoded path. How can I write
    it to interpret
    > and
    > use the variable "large" I defined above? Thank you

  • Need to use variable inside a text field.

    I have a field in my database called "introduction" that contains the following:
    "My name is #myname#"
    When I output #introduction# to the webpage, I would like #myname# to show the field value - i.e. "My name is Brett".    How do I let CF know to display the variable?    Right now, I'm gettting "My name is #myname#"
    thanks!
    B.

    This is a troublesom construct that will often devole into more trouble then it is worth, but almost everybody tries it at least once.
    Anyway you can use the evaluate() function to do what you wish.
    I.E.
    <cfoutput>#evaluate(introduction)#</cfoutput>

  • Why Does FDM need to use a Local Disk?

    Quick infrastructure question: In the Oracle install docs, under sample deployment documentation they specify that FDM needs to be run on a Local Disk. Why is that so ?

    It requires local windows files on the drive, it should never be installed on a network drive. You can place the FDM application folder directory on a network share, however the software itself must be installed on a local disk.

  • ORA-04054 : using variable substitution for the database link name

    Hi,
    I need to use variable substitution for the database link name.
    Here is my command :
    declare
    GET VARCHAR2(50);
    begin
    select OIA_GET_DESIGNATION into GET from INFODRI.OMA_IN_ARTICLES;
    for rec in (select * from [email protected]_GET_DESIGNATION)
    LOOP
    dbms_output.put_line('TEN_CODE vaut : '||rec.ten_code);
    END LOOP;
    exception
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERREUR ORACLE DETECTEE : '||rec.OIR_CUR);
    DBMS_OUTPUT.PUT_LINE('Message Erreur : '||SUBSTR(SQLERRM,1,245));
    :crd := -1;
    end;
    When I run this programm, I receive the error :
    ORA-04054: database link REC.OIA_GET_DESIGNATION does not exist
    When I replace :
    for rec in (select * from [email protected]_GET_DESIGNATION)
    by :
    for rec in (execute immediate 'select * from tensions@'||rec.OIA_GET_DESIGNATION)
    I receive the error :
    PLS-00103 : Encountered the symbol "IMMEDIATE" while parsing.
    What can I do to resolv my problem ?
    Regards,
    Rachel

    What is the name of the DB Link and the name of the object you are selecting
    from?
    I find it easier to create a view on the remote object then use that in selects.
    e.g,
    Link Name = MyLink
    Object_name = Addr_Loc
    create or replace VIEW Rem_Addr_Loc AS
    select * from addr_loc@mylink;
    In the code I then use the view
    begin
      for C_Rec in (select * from Rem_Addr_loc)
      loop
         dbms_output.put_line('Rec: '|| C_Rec.Col1);
      end loop;
    end;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Can I use variables in mxml tags?

    I want to control a lot of details in a layout.  I need to use variables to do this.  Of course I can use AS.  Is there a way to do it in the MXML tags?  See the code below.  I can do the "myLine.x = lineX" in AS.  But is there something like:  x="{lineX}" to use in a tag?  (This gives a warning, though it does work.)  It would make life faster if I could...   Is there a "right" way to do this?
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                   initialize="init()" >
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                internal var lineX:Number = 25;
                private function init():void {
                    myLine.x = lineX + 50;       
            ]]>
        </fx:Script>
        <s:Line id="myLine" xFrom="0" xTo="0" yFrom="50" yTo="300" >
            <s:stroke>
                <s:SolidColorStroke color="0x0000ff" weight="2" />
            </s:stroke>
        </s:Line>
        <s:Line id="myOtherLine" x="{lineX}" xFrom="0" xTo="0" yFrom="50" yTo="300" >
            <s:stroke>
                <s:SolidColorStroke color="0xff0000" weight="2" />
            </s:stroke>
        </s:Line>
    </s:Application>

    Hmm, thanks, that's very useful to know.
    I guess that means I should use AS.  It's not something I need to update often.  Rather, I have a whole bunch of groups of components/graphics that I want to line up based on each other--and when I change my mind about the size or position of one thing (possibly inside a container a level or two), I'd like to be able to just change one variable name rather than have to change them all by hand.  But AS can do it just fine.

  • How can I get a local path of the local disk with swf

    Since FileReference.download() doesn't download multiple
    files, I want to download files with php ftp_get by FTP.
    I need to pass the local path of the local disk where I can
    download the files from a remote serveur. How can I get a prompt to
    have a user choose a folder on his computor (local disk), if any
    way possible?

    OK, at least 3 is working.
    I don't know how you have a Tape Recorder icon on your Home Screen. I cannot add one myself. But, I am running Holo Launcher in replacement of the default LG "Optimus" User Interface. It's much better in my opinion.
    Try long pressing the icon and select Edit and maybe you can change some attribute of the icon.
    Another thing you could do, is long-press an empty area of your desktop, to add an icon. Select Shortcut, then Select Contact, and scroll through your contact list and choose the contact that you added for *86.
    You realize if you have voice mail you haven't heard, there is a tape recorder icon in the notification bar, which you touch and pull down, then press it to dial voicemail.
    If that functionality doesn't work, you MIGHT want to consider doing a factory data reset on your device, but that is going to nuke all your personalizations and cause you work to set up again.

  • Using variables in Business Rules

    Hello Experts,
    Do you know if it's possilble to declare (and use) text variables in Business Rules?
    I want to do some strings treatment (concatenation, substring) and I need to use variables.
    Regards,
    Rodrigo

    Hi,
    thanks for your answers.
    But without variables I don't know if it's possible to do the following:
    I have a member dimension (that is from text type) and I want to access to it's content and, with some string treatment, reach to a member that I will FIX.
    How can I access to the content of the text dimension member?
    I give you the example:
    Let's supose that the name of the text dimension member is TEXTMEMBER.
    For Example if I use @SUBSTRING("TEXTMEMBER", 0, 3).
    If I write the member like the above I'm not reaching to the content of dimension member....
    Do you know how to do this?
    Regards,
    Rodrigo

  • Virtual directory mapping: how to use variable in local-path element

    Hi all
    We are using a virtual-directory-mapping declaration in the deployment descriptor
    for our web application to load jsp'a and other files from the file system.
    This declaration looks like this:
    <virtual-directory-mapping>
    <local-path>c:/views/jsp</local-path>
    <url-pattern>*.jsp</url-pattern>
    </virtual-directory-mapping>
    Here is my question:
    Is there a possibility to use a variable in the local-path element? Something
    like:
    <virtual-directory-mapping>
    <local-path>%PATH_TO_JSP%</local-path>
    <url-pattern>*.jsp</url-pattern>
    </virtual-directory-mapping>
    If yes, how does it look like? My example above didn't work.
    If no, is there another way to do that?
    Thanks in advance
    Regards
    Iwan

    posting to servlets newsgroup
    "Iwan Bussmann" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hi all
    We are using a virtual-directory-mapping declaration in the deploymentdescriptor
    for our web application to load jsp'a and other files from the filesystem.
    This declaration looks like this:
    <virtual-directory-mapping>
    <local-path>c:/views/jsp</local-path>
    <url-pattern>*.jsp</url-pattern>
    </virtual-directory-mapping>
    Here is my question:
    Is there a possibility to use a variable in the local-path element?Something
    like:
    <virtual-directory-mapping>
    <local-path>%PATH_TO_JSP%</local-path>
    <url-pattern>*.jsp</url-pattern>
    </virtual-directory-mapping>
    If yes, how does it look like? My example above didn't work.
    If no, is there another way to do that?
    Thanks in advance
    Regards
    Iwan

  • VI Server - Open VI Reference is using local path, not remote

    First time posting to NI Developer Zone, so bear with me.
    I have a PXI-1050 chassis with a PXI-8187 controller that runs LabView RT.  I have set up this PXI system to utilize a VI server on port 3363 and opened access to my host PC which runs LabView 8.2 with the RT module.
    I am having trouble openning a remote VI using the VI Server and the "Open VI Reference" function.  I am fairly certain that the VI server is connecting using the "Open Application Reference" function, but it seems that the vi I wish to run cannot be found.
    Here is the error that is thrown back to me
    "Error 7
    Possible reason(s):
    LabVIEW:  File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS, and / on Linux. Verify that the path is correct using the command prompt or file explorer.
    =========================
    NI-488:  Non-existent board.
    VI Path: D:\LabView_Projects\VI_Server_Test_Project\/ni-rt/startup/temp_1.vi"
    You will notice that the "Open VI Reference" is prepending the local path 'D:\LabView_Projects\VI_Server_Test_Project\' to my remote path.  If I specify the path using Windows style path, e.g. 'c:\ni-rt\startup\temp_1.vi', again the remote VI cannot be found.  I think I am missing something trivial, but I don't know what it is.
    Thoughts?

    Several things:
    1. When u open the vi reference u must use and invoke node to make the Run vi, if you dont make it the vi is loaded but not running.
    2. Insert correctly the path on your RT and the IP of your RT target
    3. is better to have the variables on your HOST than on your RT becoz of two things:
                - Not to use resources of your RT system as memory etc... is better to use the host ones that are more available
                - The library needs to be deployed when running the vi on the host. If you put it on the RT it would need to be redeployed, so it is better to leave it on the host becoz of that.
    4. Then as the library is on the host it needs to be deployed with the proper invoke node inside a stacked sequence to ensure is the first thing you do.
    5. The enable RT fifo on the variables is used only to pass data between different vi's or processes inside the RT, it has no sense to enable it when sharing data RT - Host coz it is not possible, Shared variable work with TCP/IP not as RT FIFO.
    See the attached vi for extra info.
    I give u these extra links for your info:
    http://digital.ni.com/public.nsf/websearch/F4010DD5C8D1B13D862565BC007384E9?OpenDocument
    http://digital.ni.com/public.nsf/websearch/04D9A85B6967EE87862571140065EEC6?OpenDocument
    http://digital.ni.com/public.nsf/websearch/48D244EC86971D3986256BD4005CCC28?OpenDocument
    Regards,
    Jaime Cabrera
    NI Applications Engineering Spain
    Attachments:
    Compartida.zip ‏66 KB

  • How can I extract a file name / path from a local path variable in TestStand?

    I have local TestStand string variable, call it 'locals.path', that contains a path to a file including the file name (c:\inputs\input.txt). I need to be able to split up the path (c:\input) and the file name (input.txt) and save them into 2 local variables. What is the best way to do this?
    After reading through some of the other forums, it looks like there are some built-in functions that can accomplish this, but I am unable to find how to use them anywhere on the NI web site. One forum said to use the File I/O>Strip Path.file function. How is this called? Is this function in a DLL?
    I know that there are a number of DLLs that are installed with TestStand into the c:\windows\system32 directory. One forum made note of CVI_OpenFile / CVI_ReadFIle functions in the cvirt.dll that I used to solve a problem that I had in the past. The problem is that I had no idea that that these functions even existed and would have never known unless a similar question had been posted previously. Is there some place that these DLL function interfaces are defined or documented? Is there a function that can extract the file name out of a string for me?
    Thanks,
    Mike

    Hi,
    There sound like functions in say LabVIEW or CVI.
    I have attached a small example which may help. (I have not allowed for any error trapping, if say you dont find the file and cancel)
    Regards
    Ray Farmer
    Message Edited by Ray Farmer on 10-16-2006 10:04 PM
    Regards
    Ray Farmer
    Attachments:
    Sequence File1.seq ‏33 KB

  • Replacement Path Problem (Use in Local Formula or CKF?)

    Hello BW Experts,
    I have a couple of questions for a query I am currently working on that uses replacement path variables.
    I am looking to calculate the difference between 2 dates (u201Ctodays dateu201D u2013 u201Cstatistics dateu201D)
    The statistics date is a characteristic in the cube and for u201Ctodays dateu201D I am using a local formula using the SAP replacement path variable for todays date.
    Currently I am using the replacement path in a local formula in the columns of the query and this is fine when the reference characteristic is in the querry rows i.e statistics date.
    I believe the reference characteristic needs to be in the rows when using a formula variable replacement path in a local formula in the columns as if I remove the u201Cstatistics dateu201D from the rows the replacement path does not work.
    The actual query specification requires the u201Cstatistics dateu201D to be a u201Cfree characteristicu201D not part of the rows so the replacement path using a local formula will not work if the u201Cstatistics dateu201D is in the u201Cfree characteristicsu201D
    I have also tried using a CKF and using the same formula variable in this but it still did not work with the u201Cstatistics dateu201D in the rows?
    Do you know of any solution?
    Also could somebody explain what "Characteristic Reference (Constant 1)" means?
    Thanks in advance..
    Steve

    Hi Steve,
    I think you are right in infering that the replacement path wouldnt work if you didnt have the reference characteristic key in the rows to enable the replacement.
    I think, the solution for you could be Virtual Characteritic.
    Have you already thought about this?
    I am not aware about the characteristic reference(constant).
    Regards,
    Sunmit.

Maybe you are looking for