Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Setting Environment Variables

- - - - - autounattend SETX SET

  • Please log in to reply
1 reply to this topic

#1
APCAPC

APCAPC
  • Member
  • 1 posts
  • Joined 03-February 16
  • OS:Windows 10 x64
  • Country: Country Flag

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

Attached File  Running though bat.png   6.22KB   0 downloads

 

Command running though CMD

Attached File  running via cmd.png   218.72KB   0 downloads




How to remove advertisement from MSFN

#2
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,084 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

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







Also tagged with one or more of these keywords: autounattend, SETX, SET

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users