Using MDT Variables at a command prompt

Is it possible to use Task Sequence variables on a "Run Command Line" step?
I have as my command line:
loadstate.exe \\%UDShare%\%UDDir% /v:5 /c  /i:"C:\MININT\USMT\X64\MigApp.xml" /i:"C:\MININT\USMT\X64\MigUser.xml" /i:"C:\MININT\USMT\X64\MigDocs.xml" /i:"C:\MININT\USMT\X64\migexcludexternaldrives.xml" /i:"C:\MININT\USMT\X64\migmydocs.xml"
/i:"C:\MININT\USMT\X64\migwallpaper.xml" /config:"C:\MININT\USMT\X64\ZTIUserState_Config.xml"
And my Start in is:
C:\MININT\USMT\X64
But I receive an error that seems that it is running the command with "\\%UDShare%\%UDDir%" instead of inserting the values for the variables.

Sorry, I tried that, and it does not work.  I receive the errors:
Expand a string: loadstate.exe \\%UDShare%\%OSDComputername% /v:5 /c  /i:"C:\MININT\USMT\X64\MigApp.xml" /i:"C:\MININT\USMT\X64\MigUser.xml" /i:"C:\MININT\USMT\X64\MigDocs.xml" /i:"C:\MININT\USMT\X64\migexcludexternaldrives.xml" /i:"C:\MININT\USMT\X64\migmydocs.xml"
/i:"C:\MININT\USMT\X64\migwallpaper.xml" /config:"C:\MININT\USMT\X64\ZTIUserState_Config.xml"
Set command line: loadstate.exe \\%UDShare%\%OSDComputername% /v:5 /c  /i:"C:\MININT\USMT\X64\MigApp.xml" /i:"C:\MININT\USMT\X64\MigUser.xml" /i:"C:\MININT\USMT\X64\MigDocs.xml" /i:"C:\MININT\USMT\X64\migexcludexternaldrives.xml" /i:"C:\MININT\USMT\X64\migmydocs.xml"
/i:"C:\MININT\USMT\X64\migwallpaper.xml" /config:"C:\MININT\USMT\X64\ZTIUserState_Config.xml"
Start executing the command line: loadstate.exe \\%UDShare%\%OSDComputername% /v:5 /c  /i:"C:\MININT\USMT\X64\MigApp.xml" /i:"C:\MININT\USMT\X64\MigUser.xml" /i:"C:\MININT\USMT\X64\MigDocs.xml" /i:"C:\MININT\USMT\X64\migexcludexternaldrives.xml" /i:"C:\MININT\USMT\X64\migmydocs.xml"
/i:"C:\MININT\USMT\X64\migwallpaper.xml" /config:"C:\MININT\USMT\X64\ZTIUserState_Config.xml"
Executing command line: loadstate.exe \\%UDShare%\%OSDComputername% /v:5 /c  /i:"C:\MININT\USMT\X64\MigApp.xml" /i:"C:\MININT\USMT\X64\MigUser.xml" /i:"C:\MININT\USMT\X64\MigDocs.xml" /i:"C:\MININT\USMT\X64\migexcludexternaldrives.xml" /i:"C:\MININT\USMT\X64\migmydocs.xml"
/i:"C:\MININT\USMT\X64\migwallpaper.xml" /config:"C:\MININT\USMT\X64\ZTIUserState_Config.xml"
Failed to run the action: Run Command Line. 
The drive cannot find the sector requested. (Error: 0000001B; Source: Windows)
The execution of the group (State Restore) has failed and the execution has been aborted. An action failed.
Operation aborted (Error: 80004004; Source: Windows)
Failed to run the last action: Run Command Line. Execution of task sequence failed.
The drive cannot find the sector requested. (Error: 0000001B; Source: Windows)
Task sequence execution failed with error code 80004005

Similar Messages

  • Using a variable in netsh command to set ip address on NIC

    hi friends
    i wrote an script which gets an input & use that variable to set ip address on NIC. but actually it doesn't set ip address. may you please help me.
    my script contains:
    $VMNumber=Read-Host "please enter your VM number (for example 2)"
    Netsh interface ipv4 set address NIC static 192.168.1.$VMNumber

    1. I do not thing that the use of netsh is a right way.
    2. You will need a table with MAC address in first column and IP address in second to correctly map IP address to computer. MAC addresses are unique identification.
    3. Follow this article including comments and adapt scripts to your task
    http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/
    HTH
    Milos
    hi Milos
    thank a lot for your useful answer.
    but let me say that my need has nothing to do with MAC address.
    in my test lab, i need an script which asks the administrators to enter their VM number & it saves this input as a variable & set is as the last octet in their VM IPV4 Address.
    so can we tell it as a rule that variables we create in powershell, can't be used inside non cmdlets (inside legacy cmd commands) ?

  • Using presentation variable in a dashboard prompt

    Hi All,
    Can we use a presentation variable set in 1 dashboard prompt in another dashboard prompt to filter the values shown in the prompt based on the value selected in the first prompt?
    I am using SQL results in the second prompt.So, Iam not able to constrain the results. Any ideas?
    Thanks.

    Steps:
    1. 1st Dashboard prompt set Presentation Variable name say pdashboardprompt1
    2. In 2nd Dashboard prompt set Presentation Variable name say pdashboardprompt2
    In SHOW SQL results for 2nd Dashboard prompt. Select constraint
    SELECT Table1.Column1 FROM "SA" WHERE Table1.Column2 = '@{pdashboardprompt1}'

  • Using presentation variables selected in dashboard prompt in query builder

    In dashboard prompt I have made four dropdowns(have four presentation variables) and based on these values selected,can the Query Builder generate dynamic reports based on the presentation variables selected?
    I will provide the link(i.e Link of BI publisher where I stored the report) displayed to the user based on Four presentation variables.
    If we click on that link can we use the presentation variables in where clause of Query Builder in BI Publisher?
    Please help me out
    Thanks in Advance

    - OK. In the second prompt, instead of setting Default to SQL Results, set it to Specific Value.
    - Then insert '{pres_var}' in the window. I got it to work this way.
    - It supplied the PV as the default in the second prompt after hitting "Go" on the first prompt.
    Hi, thanks for your suggestion but I don't need to have the value of the presentation variable itself as the prompt default. The variable is a filter for a specific SQL clause and the default is the result of this SQL.
    Cheers
    DrPlexi

  • Using environment variables in RMAN command line

    I'm running Oracle 11gR2 and working in a Solaris 10 environment.
    I am trying to run the rman command by connecting to the target, auxiliary, and catalog by catting out the contents of password files where I have my connect strings stored for each database. Also in there I am trying to use environment variables to reference each database.
    rman target "`cat ${HOME}/password_dir/prod_connect.txt`@${PROD_DB}" auxiliary "`cat ${HOME}/password_dir/stage_connect.txt`@`${STAGE_DB}`" catalog "`cat ${HOME}/password_dir/rman_catalog_connect.txt`@${RMAN_CATALOG_DB}"
    The end result I need is:
    rman target "username/password@db" auxiliary "username/password@db" catalog "username/password@db"
    Is this possible?

    Levi,
    Good idea on the variables. I set up a variable with my connect string including the TNS reference (i.e. user/password@XXX)
    So when I run this:
    rman auxiliary ${AUXILIARY}
    I get this:
    Recovery Manager: Release 11.2.0.2.0 - Production on Wed Jun 13 10:19:44 2012
    Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00554: initialization of internal recovery manager package failed
    RMAN-04006: error from auxiliary database: ORA-01031: insufficient privileges
    But if I try to run it without the TNS entry it works. The only issue with that is I need the TNS reference to connect to the database I'm cloning from. Any idea what's going on here?
    Also, the same applies to the TARGET, but oddly enough not the CATALOG. It will connect to my rman catalog using the TNS just fine. The only difference is with the catalog I'm logging in as my rman catalog user. With the TARGET and AUXILIARY I'm logging in as the system user.
    Edited by: Nevin on Jun 13, 2012 8:25 AM

  • Using Java To Open Terminal/Command Prompt

    I wanted a .jar file to open the terminal/command prompt on execution so that i can use System.out to display all the information needed...Is this possible? If so what code can i use to open the command prompt from java
    Thanks a lot ppl ;)

    Terminal prompt is plataform dependent, I would not advise you to do that. If your system outs are logging, i sugest you to use any logging api. If you are trying to display text information to the user, open any text widget and output there.
    May the code be wiht you.

  • Use Applescript variable in Python command line

    Using automator
    Python Shell Output -> [1,2,3,4,5]
    goes to Applescript
    Run Applescript ->
    on run {input}
        set seq_list_appscript to {}
        do shell script "python -c 'for s in input: print s'"
    end run
    it doesn't work . . . how can I call the "input" which is an Applescript variable within the "do shell script" python command line ?

    If the input is actually a list of items, then you would need to iterate through them or coerce the list to something for the command line.  If the input is just the text "[1,2,3,4,5]", then the variable just needs to be inserted into the text of your script statement - the results of the script are returned by the do shell script command, so they can also be assigned to a variable:
        set whatever to (do shell script "python -c 'for s in " & input & ": print s'")
        display dialog whatever

  • Using Java in windows command prompt

    Hi,
    I don't know if I have been searching correctly, but I haven't found a solution to my problem through common search engines.
    I'm programming in java using vim (accessed through windows command prompt), and I've created classes, everything compiles fine.
    However, I wanted to test my classes my creating instances of them (i.e. objects) through the same windows command line (command prompt). I know you can achieve this by using interaction panes through third party programs such as Dr.Java and eclipse, but I was wondering if this can be done using the command line.
    Thanks
    Jaime

    Thanks Paulcw for your quick reply! :D
    I'm guessing I didn't word my question properly.
    Neither of my classes have a main method in them, so when I am trying to create instances (objects) of them, I would like to as if my command line was the main.
    For example:
    Class1 c = new Class1(parameters);
    c.moveRight();
    etc.
    I'd like to be able to use my classes methods from the command line, I think what I'm looking for is a batch, but I'm not sure.
    Thanks again,
    Jaime

  • StringTokenizer to read in 4 variables from the command point

    Hi,
    I need to set up the Java StringTokenizer to read in 4 variables
    from a command prompt. It should be in the following format:
    X variable1 variable2 variable3where
    (is the command prompt)X (is either +, -, *, /, c, or e)
    variable1 variable2 and variable3 are integers.
    I would appreciate any answers that would help me find the way!
    Thanks in advance.

    Thank you for the code snippet, but the program does not function that way. Ie, it does not accept
    arguments when the program is first run, only after the program has excecuted.
    The program is to enter a simple command prompt, and await instructions in the form X int1 int2 int3
    where X can be c (convert the number int3 from number base int1 to number base int2), e (exit the
    program), +,-,/,* (add, subtract, divide or mutilply int2 to/by int3 in number base int1). Here is an example
    of the what the program execution should look like:
    c:\programming\java nbc
    > + 10 23 45 // Add 23+45 in base10
    68 // Write the answer on a new line and prompt
    - 16 5A 2C // Subtract 5A-2C in base 162E // Write the answer on a new line and prompt
    c 15 7 2E // Convert 2E in base 15 to base 762
    e // End of programc:\programming\
    My problem is, I do not know how to convert the first token to a variable that can be used to carry out one of
    the above mentioned procedures. For example, the first token taken from the command c 15 7 2E is "c".
    As I understand it, "c" is simply a string, and this cannot be used in logical procedures such as:
    int procedure = 0;
    if(operator == "c")
         procedure = 0;  //then use this variable
    }else
    if(operator == "e")
        System.exit(0): //quit the program
    Also, how can I set up a while loop to continuesly
    prompt the user for an instruction until "e" is entered?import java.io.*;
    import java.util.*;
    import java.util.StringTokenizer;
    public class blerk
         public static void main(String[] args) throws IOException
              InputStreamReader stdin = new InputStreamReader(System.in);
              BufferedReader br = new BufferedReader(stdin);
              boolean e = true;
              String str = "";
              String symbol = "";
              int value0 = 0;
              int value1 = 0;
              int value2 = 0;
              System.out.print(">");
              str = br.readLine();
              StringTokenizer st = new StringTokenizer(str, " ");
              int i = 0;
              int option = 0;
              while (st.hasMoreTokens())
                   switch(i)
                        case 0:
                             symbol = st.nextToken();
                             // This part is obviously not correct. How can this be implemented to select and store the operating procedure the user enters?
                             if(symbol = "e")
                                  System.exit(0);
                             }else
                             if(symbol = "c")
                             }else
                             if(symbol = "+")
                                  option =
                        break;
                        case 1:
                             value0 = Integer.parseInt(st.nextToken());
                        break;
                        case 2:
                             value1 = Integer.parseInt(st.nextToken());
                        break;
                        case 3:
                             value2 = Integer.parseInt(st.nextToken());
                        break;
                        default:
                             System.out.println("format: >operator x y z");
                        break;
                   i++;
              System.out.println(symbol + value0 + value1 + value2); //test
    Any advice would be most appreciated.
    Benjamin.

  • Error to execute the script through command prompt

    I tried to execute the script through command prompt. I got some following error. Could you please advice me how to rectify this.
    cscript D:\JS\Test.js
    Microsoft (R) Windows Script Host Version 5.6
    Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
    D:\JS\Test.js(1, 1) Microsoft JScript runtime error: 'app' is undefined.
    Thanks,
    Prabudass

    I haven't use CS for quite some time and file associations may not work with the command prompt.
    You can try using Windows Explorer to browse to a .js file then right click on that file. From the popup menu choose Open With. Even if you see Photoshop in the file list choose Browse at the bottom. Browse to Photoshop and make sure to check 'Always use selected program...'
    If that doesn't work you will need to create an action that runs your script and make a droplet from that action. You can then use the droplet in the command prompt. You may also need to create a 'dummy' image file to launch the droplet with if you script doesn't require an open document at startup. See http://www.ps-scripts.com/bb/viewtopic.php?t=967

  • MATRIXx 7.1.4 on Win2000 oscmd() dos not respond the same as command prompt

    I am transitioning from Unix to Windows platforms as thus need to modify many commands that have been developped over the years. Some of these use oscmd() to run operating system commands.
    I am running Matrixx 7.1.4 on Windows 2000 and get a different response for the same command if I run it from a command prompt window versus using oscmd().
    e.g.
    Command Prompt
    * I have file temp1.txt in path NCAP which contains 4 lines
    line 1
    line 2
    hello my name is
    line 3
    from the prompt I run
    c:\NCAP> sed s/"hello my name is"/"hello my name is Brian"/ temp1.txt >temp2.txt
    A new file is created temp2.txt with 4 lines as follows:
    line 1
    line 2
    hello my name is Brian
    line 3
    MATRIXx
    * local directory set to C:\NCAP
    >cmd = "sed s/""hello my name is""/""hello my name is Brian""/ temp1.txt >temp2.txt"
    cmd (a string) = sed s/"hello my name is"/"hello my name is Brian"/ temp1.txt >temp2.txt
    >oscmd(cmd)
    line 1
    line 2
    hello my name is Brian
    line 3
    sed: can't read >temp2.txt: Invalid argument
    ans (a scalar) = 2
    * no new file is created??
    What am I missing?

    I realize this is a little late to help you, but it might help someone else.  The command will work if it is started with 'start cmd /C "args" '. For example:
    command = "start cmd /C ""sed s/""hello my name is""/""hello my name is Jose""/g temp1.txt >temp2.txt"""
    oscmd(command);
    will do what you want to do. 
    You might also have problems using grep with the pipe "|" command.  If you want to do something like this: 'dir | grep bytes',  [out=format]===oscmd(command) will not return the expected output in out. The only thing I could figure out is to begin the command with 'start cmd /C', redirect the output to a temp. file and read it in using [out=format]===oscmd("type temp.txt') . Now out will contain the expected output. If anyone else knows a slicker method, please post it.
    Regards,
    Jose

  • How to declare a bind variable with 'date' data type in command prompt?

    how to declare a bind variable with 'date' data type in command prompt?
    sql>variable q date;
    when i execute it show list of datatypes

    Hi,
    As Lokanath said, there are no DATE bind variables.
    You can use a VARCHAR2 bind variable, and convert it to a DATE in your SQL statment.
    If you're using SQL*Plus, consider a substitution variable. It won't be as efficient as a bind variable, but it will be as convenient.
    For example:
    DEFINE  first_entrry_date = "DATE '2010-06-20''
    SELECT   ...
    WHERE   entry_date >= &first_entry_date
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to get the drive letter of a Volume using command prompt

    Using windows command line tools i want to get the drive letter of a volume, by specifying its volume number.
    For example i have a HDD with 2 volumes: Volume-0 and Volume-1
    I want to set a Variable say 'Letter'=<Drive Letter> such as
    SET Letter=<Command> <Volume Number>
    Is there any command which can do this for me...
    Thanks...

    Hi,
    You can use the diskpart tool to assign a drive letter to the drive by specifying the volume's number.
    1.Open Command Prompt.
    2.Type:diskpart
    3.At the DISKPART prompt, type:list volume
    Make note of the number of the simple volume whose drive letter you want to assign, change, or remove.
    4.At the DISKPART prompt, type:select volume n
    Select the volume, where n is the volume's number, whose drive letter you want to assign, change, or remove.
    5.At the DISKPART prompt, type one of the following:assign letter=L
    Where L is the drive letter you want to assign or change.
    For more detailed information, you could refer to the article below:
    Assign, change, or remove a drive letter
    https://technet.microsoft.com/en-us/library/cc757491(v=ws.10).aspx
    Best Regards,
    Mandy 
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Using Javadoc with Command Prompt

    Hi is there anyway where I can use javadoc using command prompt?
    my friend said is
    "C:>javadoc *.java"
    but it did not work for me but can work for him...
    any help pls?
    THanks

    Search for the file javadoc.exe in your computer.
    If found, change to that directory* and issue a valid javadoc.command.
    If not found, download and install Java's JDK, which contains the file.
    * You can also set your os's path variable to include this directory.

  • Error 5: Access is Denied While using OSCDIMG to create Winpe x86 ISO with Deployment Tools Command Prompt

    Technician computer is Windows 7 HP x64.
    Running latest version of WAIK.
    Goal: To make a Winpe disc for each processor architecture (AMD64, x86, IA64) with an included Gimage.exe using this code for the default startnet.cmd file found in system32 directory of winpe boot.wim
    wpeinit
    if /i %PROCESSOR_ARCHITECTURE%==amd64 (
    cd x64
    start gimagex.exe
    if /i %PROCESSOR_ARCHITECTURE%==ia64 (
    cd x64
    start gimagex.exe
    if /i %PROCESSOR_ARCHITECTURE%==x86 (
    cd x86
    start gimagex.exe
    These are the commands I have processed for the x86 variant:
    copype x86 c:\pe\x86\
    Dism /mount-wim /wimfile:C:\pe\x86\winpe.wim /index:1 /mountdir:C:\mount
    **It is at this point I copy over my x86 folder, x64 folder, and overwrite the startnet.cmd file.
    dism /unmount-wim /mountdir:C:\mount /commit
    oscdimg -n bc:\pe\x86\etfsboot.com c:\pe\x86\iso c:\pe\x86.iso
    ^^It is at this command I receive this error:
    ERROR: Could not delete existing file "c:\pe\x86\iso"
    Error 5: Access is denied.
    Please note that all commands before were hand-typed, no copy or pasting from any directory or .chm
    One thread referred to some Application Management service, but I can report that there is no such service installed in my machine.
    Thank You!
    UPDATE:
    I copied the winpe.wim file from the x86 root directory into the iso directory and renamed it to boot.wim Now, if I copy the contents to a flash drive and put it into a client
    computer, it boots to the PE perfectly, script and all.
    However, when trying to use the oscdimg command, I do get an .iso successfully, but when I burn it, I don't know what to do in the way of boot options, and if I keep defaults (imgburn)
    it results in an un-bootable dvd. 
    Suggestions are greatly appreciated.

    Don't copy and paste instead type manually it will work.
    [email protected]
    OMG! Yes, you are correct ... but I have no idea why! I retyped the command line:
    oscdimg -n -be:\winpe_amd64\etfsboot.com e:\winpe_amd64\ISO e:\winpe_amd64\winpe_amd64.iso
    into Notepad, and then pasted it into the Command Prompt, and it worked!
    Perhaps there must be some hidden characters included when pasting directly, even though I first pasted the command line into Notepad, and then into Command Prompt
    (C:\Program Files\Windows AIK\Tools\PETools>).
    I had to retype the command line in Notepad before copying and pasting, before it would work.
    Wow, thanks!
    Cheers, Navy Flyer

Maybe you are looking for

  • Receiving error message: "Firefox is unable to determine if there is an update available".

    I am running Firefox 31.0 on Mac OS X 10.6.8. I have it set to automatically check for updates, but not to automatically install them. Lately, I keep getting the error message "Update Failed" & "Firefox is unable to determine if there is an update av

  • How to include a slug-type area on PDF export

    Does anyone know how I can include a slug area (or something similar) on an AI file when I save as PDF?  I need to include a part number, revision number and date of the file for reference purposes.  I've tried searching and can't seem to find a solu

  • Quality issues with VGA port on Type 2504 docking station

    Hi, I see quality issues on the VGA output of the Type 2504 docking station with a T61. The monitor image is blurred, not much, but enough to be irritating. When I compare the DVI output with the VGA output on two equal NEC MultiSync LCD 2170NX monit

  • Special G/L Indicator F Is Not Defined for Down Payment

    Dear All, While creating down payment request (t.code f-47), I specified 'F' in Trg.sp.g/l ind check box, the system thrown a message as, 'Special G/L indicator F is not defined for down payment' . And When I tried with "A" in stead of "F", I am able

  • Is Metadata Backup possible to be automated through taskflows?

    Hi, I wanted to know if metadata backup is possible through taskflows. I am aware that there is an Extract Data in the Actions when you create a taskflow but where do the files go after being extracted? Can I specify a specific server or path for its