Coding of PowerShell - path and Variable issues

Hello, I work with a program of powershell to copy a file on my USB key and in the boot of the user file what ever is connected to this computer.

My code is

:
PowerShell-command {}; $a = [environment]: UserName. $c='E:\Other\Programs\program2.bat'; $b = "C: / Users / $a/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup"; copy $c $b. Start-sleep 30

It uses only the $a instead of the variable name... If I change it to "" it is said that the path is not found a cmd or an executable program. and it stops at Windows/Start

can someone help me with this?

For anyone who was wondering why I am using powershell-command instead of ISE is because I'm running it from a .bat file because the execution policy is set to restricted AND cannot NOT BE CHANGED.

This issue is beyond the scope of this site and must be placed on Technet or MSDN

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

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

Tags: Windows

Similar Questions

  • How the PATH environment variable longer?

    Hello

    I use Windows Vista Business.  Lately, I just installed the beta of Intel Parallel Studio and found that my path variable ran out of space.  Internet research concluded that there cannot be more than 1024?
    It is too little for me to welcome all directories program that I installed, and thus some programs no longer work correctly.
    I wonder if there-
    (a) is a way I can expand the size of the Path system variable?
    (b) add another variable which can take some Path variable values so that I do not violate the limitation of 1024.
    Thanks in advance!
    A

    Hello, Gutsingh

    The PATH environment variable has a fixed limit of 1023 characters can be used. It doesn't seem to be a way to extend this. Other environment variables have a higher limit, which can be useful.

    Let us know if that helps.

    David
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Problem with the Java PATH and HOME.

    Hey, so I tried to run a Java program through the console but I got an error that says:

    ERROR: JAVA_HOME is not set and no "java" command could not be found in your PATH.

    Please set the JAVA_HOME variable in your environment to match the installation location of java.

    So I edited the variable path: C:\Program Files\Java\jdk1.8.0\bin\java.exe and the JAVA_HOME variable to: C:\Program Files\Java\jdk1.8.0\bin\java.exe and I also tried to use jre8 instead of jdk1.8, but the program still did not run. Already, I went on the java Web site and the site Internet said the same thing about what to do so I ask here see if someone knows how to do this. I already know how to change system variables, but I'm doing something wrong with the path and the JAVA_HOME or y at - it a bug or something?

    Hello

    Check with the support of the Java program and the Support of Java - e-mailer or enter
    a message on their site if possible. Possible the program makes a wrong call.

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • Actions and Variables are duplicated when I create the new model project

    My organization uses a standard model for our courses.  In this model, I added a few variables and advanced actions to enable to the learner to customize the course a bit and support our "test-out" option

    What I found however, is that when I create a new project of this model that all stocks advanced and variable are... reproduce some several times.

    And ideas on how to make this stop?

    Jay

    Unfortunately, this is a known issue.  I pointed out about it here:

    Problems of duplication in Adobe Captivate Cp7 Cp8 Templates | Infosemantics Pty Ltd

    As far as I know, the problem persists even in Captivate 9 If you create a template that has advanced Actions, and these actions are used by no slides in this model.  When you create a file CPTX of this model, Variables and advanced Actions are duplicated by about the same number of times that the advanced initial Action is used.

    You can test this by creating a simple project with two blades, a variable and a Standard Action that affects this variable with values. Define the event on slide enter on the second slide to run the Standard Action. Save the project as a model CPTL and then use this model to start another project CPTX file.  When you check the list of Variables and advanced Actions you will find that there is a duplicate of each.

  • Error message: PRVF-3929 - PATH environment variable.

    Hello

    I'm trying to install Oracle on my laptop and get the following error message resulting in installation hault.

    INFO: *********************************************
    NEWS: Environment Variable: 'PATH': this test checks if the length of the 'PATH' environment variable does not exceed the recommended time.
    INFO: Severity: CRITICAL
    INFO: OverallStatus:VERIFICATION_FAILED
    INFO: -----------------------------------------------
    INFO: Results of the audit for node: JF - PC
    NEWS: Expected value: 1023
    NEWS: Real value: 1159
    INFO: Error Message: PRVF-3929: adding location of Oracle binary in the PATH environment variable exceeds the length limit of the BONES of "1023" for the variable on node "JF - PC."
    INFO: Cause: the installer must update the environment variable PATH to include the value of '% ORACLE_HOME%/bin';.
    However, this will cause a path exceeds the maximum allowed length that allows the operating system.
    INFO: Action: make sure that the sum of the length of your current PATH environment variable and one of
    "% ORACLE_HOME%/bin;" does not exceed the limit of the operating system.
    Restart Setup after correcting the value of environment variable.


    Installation of the ton tent of the Oracle database - win64_11gR2

    MY PC CONFIGURATION:
    -Windows 7
    -64-bit

    Can you please help me get this resolved please.

    The following information appears to be linked: http://support.microsoft.com/kb/830473

    According to the link above, the maximum length of the PATH environment variable is 2048/8192 characters. Apparently the length has been increased to 2048 from Windows XP SP2. Your current path is about 1200 characters that is less than the limit of the OS.

    The Oracle installer is incorrect about the PRVF-3929 error message? Or if the length of the path environment variable is not the real problem? Maybe you can try temporarily shorten the path and add the full pathname after the installation of Oracle.

    You should be able to modify the path as follows:
    From the desktop, do a right click my computer, and then click Properties.
    In the System Properties window, click the Advanced tab.
    In the Advanced section, click the Environment Variables button.

    Using Windows 7 Professional? If the error message occurs even with a short path, then maybe there something else trigger this error, as the antivirus or other security software.

    Published by: Dude on July 3, 2011 11:15

  • Oracle files in "PATH" system variable of environment

    What Oracle files must exist in the system 'PATH' Environment Variable in Windows operating system?
    Records must contain Oracle command line utilities, such as "sql * more", "exp" and so on.

    The path to your bin folder...
    for example:

    D:\oracle\product\10.2.0\db_1\bin;
    

    Soon :)
    Renjith Malet

  • Path environment variable limitation

    Hello

    On a windows 2003 Server SP2 a program does not start when the PATH environment variable is longer than 1023 characters

    I have a similar limitation on windows XP, but the limit seems to be 2047

    I found a link that talks about this kind of limitation, but nothing that has a list of the limitation of path on the Windows platform environment several.  This limitation is resolved by a patch?

    Please let me know

    Hi patriciachocho,

    Your question of Windows 2003 is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please ask your question on the TechNet.  You can follow the link to your question:

    http://TechNet.Microsoft.com/en-us/WindowsServer/bb512919

  • 1V - 5v linear output using power supply 5v, voltage divider, and variable resistance

    How can I get 1v - 5v output linear using power supply 5v, voltage divider, and variable resistance?

    Have the you wired as an attachment?  Using my schema, you can calculate the current flowing through the pot based on the fall of the tension in the pot

    4V / 10Kohm = 0.0004

    Kirchhoff's current law, we know that the same current flows through the circuit so now we can calculate the leg below the wall, based on the current and the fall of desired voltage across the resistance

    1V / 0.0004 A = 2.5 K Ohm

    My scheme maintains the current flowing through the circuit of constant, so the voltage divider must never change.  Assuming a linear pot, you will get a swing of such linear voltage as measured at the wiper.  If you wired the pot, a different way, then more then likely, you change the total resistance of 5V ground that would have the common effect that would effect the tensions.

  • I can't send email Outlook Express (sudden problem). It is a new and sudden issue. Error number: 0x800CCC67

    Original title: I can't send email Outlook Express (sudden problem). It is a new and sudden issue.

    I use Outlook Express 6 and make this message. An unknown error has occurred. "Account: 'XTRA', server: 'smtp.xtra.co.nz', Protocol: SMTP, server response: ' 421 mta01.xtra.co.nz connection refused [222.155.136.138] ', Port: 25, secure (SSL): no, Server error: 421, error number: 0x800CCC67.

    Continues to receive e-mails.

    Hello

    Have you made changes on the computer before this problem?

    The following article might be useful.

    Troubleshooting error messages that you receive when you try to send and receive e-mail in Outlook and Outlook Express
    http://support.Microsoft.com/kb/813514

  • I downloaded a Coded for Movie Maker and tried to play a YouTube clip to edit and it shows nothing happening just the clip. If anyone can help I would really appreciate it

    I downloaded a Coded for Movie Maker and tried to play a YouTube clip to edit and it shows nothing happening just the clip. If anyone can help I would really appreciate it

    Hello

    I suggest you follow the link to import files into Windows Movie Maker below:

    http://Windows.Microsoft.com/en-us/Windows-Vista/importing-files-into-Windows-Movie-Maker-frequently-asked-questions

    I also suggest you check the Web site software codec for further assistance, or try another program to convert the files.

  • Is it possible to define the name of the path and inside the MSI log file

    Is it possible to define the name of the path and inside the MSI log file, so that it should not be set from the command line.  This way just race the msi causes always a logfile in a specific path and the file name?

    Read the following article and see if it helps.  In my view, it is possible to use InstallShield, but I'm not sure.  It's just a little out of my League. http://www.flexerasoftware.com/webdocuments/PDF/msi_writing_to_the_log_file.pdf.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • My Windows 7 Pro system has some serious hardware, internet connection and security issues. The system image and restore the system in case of failure.

    My Windows 7 Pro system has some serious hardware, internet connection and security issues.

    My efforts to remedy by restoring a system image backup failed.  At this point, I'm ready for a new clean install if I have to buy a drive to do.  My question is whether a professional Ultimate upgrade will or will not fix these bugs.  In addition, what is the cause of restoring the system to fail?  I never turned off or cannot create regular restore points.

    Original title: upgrade a "Fix" for existing system problems?

    My Windows 7 Pro system has some serious hardware, internet connection and security issues.

    My efforts to remedy by restoring a system image backup failed.  At this point, I'm ready for a new clean install if I have to buy a drive to do.  My question is if an upgrade to Professional Ultimate will be or not correct not these bugs.  Also, what is the cause System Restore to fail?  I never turned off or cannot create regular restore points.

    Hello

    1 re-installing/repairing software will not fix hardware issues.

    2. the operating system upgrade is not the way to solve computer problems that can be carried forward.

    3 1. If you use Norton, you should disable Norton inviolable Protection before using System Restore.

    http://Service1.Symantec.com/support/sharedtech.nsf/pfdocs/2005113009323013

    AVG will cause problems with SR too.

    «Temporarily disable AVG»

    http://www.Avg.com/ww-en/FAQ.Num-3857

    2. try to use Safe Mode system restore.

    http://Windows.Microsoft.com/en-us/Windows7/products/features/system-restore

    "Start your computer in safe mode.

    http://Windows.Microsoft.com/en-us/Windows/Start-computer-safe-mode#start-computer-safe-mode=Windows-7

    3 Malware will stop at the system restore.

    Download, install, update and scan your system with the free version of Malwarebytes AntiMalware:

    http://www.Malwarebytes.org/products/malwarebytes_free

    ____________________________________

    We really need for more details:

    "My Windows 7 Pro system has some serious hardware, internet connection and security issues.

    See you soon.

  • How to specify "device = true/false" what URL's path and querystring

    e.g. http://myserver.com/path/my.php?id=xxxxxx&name=xxxxxxxI have been read many examples on the addition of "device = true/false" or "interface = wifi" based in the current connection service. But all these examples assume that doesn't URL {t have path or from a query string:}

    for example http://myserver.com;device=true

    I need access to a server where the resources are way and I set up via QueryString

    for example http://myserver.com/path/my.php?id=xxxxxx&name=xxxxxxx

    I've been adds "device = true" at the end of the URL and at the end of the hostname

    for example http://myserver.com/path/my.php?id=xxxxxx&name=xxxxxxx;device=true

    for example http://myserver.com;device=true/path/my.php?id=xxxxxx&name=xxxxxxx

    and none of these works. Is it possible to specify when the URL path and use querystring

    I'm working with JDE Plugin 4.5, Ecliipse 3.4 for Curve 8310 and 9000 "BOLD"

    Thank you

    f

    You always add the connection at the end of the full URL string, regardless of what contains the URL.

    The connection string is stripped by the treatment of Blackberry so that your host be confused by it.  The connectin string is used by the BlackBerry to determine what BlackBerry connection path will be used for the connection.

    BTW, this is '; '. deviceside = true/false", not"peripheral", which could explain part of your problem.

    I think this article explains all the possible connection strings:

    What - in different ways to establish an HTTP connection or socket

    Article number: DB-00396

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

    For more information, I recommend the section required reading of this thread:

    http://supportforums.BlackBerry.com/T5/Java-development/connecting-your-BlackBerry-http-and-socket-c...

  • Oracle installation path environment variable

    Original title: 7 Edition windows path environment variable home premium

    Hi, I'm installing personal oracle on my computer. He told me that the 'PATH' environment variable will be too long if oracle is added to it. Here is the curremnt path:

    C:\Program Files\Common Files\Microsoft Shared live; C:\Program Files (x 86) \Common Files\Microsoft Shared Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\; C:\Program Files (x 86) \Windows Live\Shared; C:\Program Files (x 86) \Microsoft SQL Server\100\Tools\Binn\; C:\Program Files\Microsoft SQL Server\100\Tools\Binn\; C:\Program Files\Microsoft SQL Server\100\DTS\Binn\; c:\Program Files (x 86) \Microsoft SQL Server\100\DTS\Binn\; c:\Program Files (x 86) \Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\; C:\Program Files (x 86) \Common Files\Roxio Shared\DLLShared\; C:\Program Files (x 86) \Common Files\Roxio Shared\9.0\DLLShared\; C:\Program Files (x 86) \Common Files\Roxio Shared\DLLShared\; C:\Program Files (x 86) \Common Files\Roxio Shared\13.0\DLLShared\; C:\Program Files (x 86) \Microsoft ASP.NET\ASP.NET Web Pages\v1.0\; C:\Program Files\MySQL\MySQL Server 5.1\bin; C:\Program Files (x 86) \QuickTime\QTSystem\; C:\Microsoft SQL Server Migration Assistant for Access\bin\

    If I remove anything in the path, it will cause do not run programs? also, is there something that I should not remove?

    Thank you.

    Hello

    It seems to be a problem is with Oracle, so I suggest you get in touch with support for Oracle from the link below.

    https://support.Oracle.com/CSP/UI/Flash.html

  • I click on "change drive letter and paths" and nothing happens.

    I need to change the drive letter on my iPod and every time I go into disk management I click with the right button on my iPod and then click on "change drive letter and paths" and absolutely nothing happens. I tried to change it and I'm just stuck on this step.

    I need to change the drive letter on my iPod and every time I go into disk management I click with the right button on my iPod and then click on "change drive letter and paths" and absolutely nothing happens. I tried to change it and I'm just stuck on this step.

    Have you installed the latest drivers for your pad? There are a lot of driver downloads for windows, iPad etc.

    Maybe you need the correct driver for your IPad and you will then be able to change the drive letter...

Maybe you are looking for