Sign in to follow this  
Followers 0
APCAPC

Setting Environment Variables

2 posts in this topic

I have created working AutoUnattend file for windows 10 which has the following command working

 

cmd /c FOR %i IN (C D E F G H I J K L N M O P Q R S T U V W X Y Z) DO IF EXIST %i:\AppsRoot.txt SETX AppsRoot %i:\ -m

 

However i want to run this command manually though a .bat file on machines which have not been installed though my autounattend file.

 

However if i put this command into a .bat it will not execute. (the brackets on the command dont seem to work)

However if i put this command into command prompt directly it will work.

 

Exact same command one is just manually put into command prompt and one is in a bat file...

 

Help?

Command Running via Bat

post-413206-0-79729200-1454543310_thumb.

 

Command running though CMD

post-413206-0-66840600-1454543324_thumb.

0

Share this post


Link to post
Share on other sites

Running from a batch file you would need this:

FOR %%i IN (C D E F G H I J K L N M O P Q R S T U V W X Y Z) DO IF EXIST %%i:\AppsRoot.txt SETX AppsRoot %%i:\ -m

Note the double percent characters

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.