Questions tagged [setx]

SETX is a command to set something to Windows registry or system variables through Windows Command-Line or Batch-Files.

37 questions
84
votes
12 answers

How do I add to the Windows PATH variable using setx? Having weird problems

I want to modify the Windows PATH variable using setx. The following works at least 50% of the time on Windows 8: setx PATH %PATH%;C:\Python27\;C:\Python27\Scripts\ If it gives the error "the default argument can only be used 2 times", then the…
SerMetAla
  • 3,602
  • 4
  • 25
  • 23
28
votes
7 answers

SETX doesn't append path to system path variable

I have tried below command to append some path to system path variable by batch-file : setx PATH "%PATH%;C:\Program Files\MySQL\MySQL Server 5.5\bin" I have checked system variable path after running above batch-file, above path isn't in…
Hamed Kamrava
  • 10,533
  • 32
  • 78
  • 117
9
votes
3 answers

How to append values to the PATH environment variable in NodeJS?

Following the answer suggested in the question - Is it possible to permanently set environment variables? I was able to set new environment variables permanently with the command - spawnSync('setx', ['-m', 'MyDownloads',…
Paz
  • 763
  • 2
  • 10
  • 26
9
votes
6 answers

Android setX() and setY() behaving weird

I am trying to dynamically create and then move an image in an Android activity. However, the setX() and setY() methods seem to not work correctly. It correctly sets the position of an image when it is first created and placed, but any attempt to…
user2423199
  • 111
  • 1
  • 1
  • 3
8
votes
3 answers

Invalid syntax with "setx" for having more than two arguments when there are only two arguments

I'm having trouble setting the global environment variable PATH permanently with SETX. I've read the answers on similar questions such as Invalid syntax with setx as well as read the syntax on SS64. As far as I know, the following line follows the…
octopod
  • 764
  • 1
  • 8
  • 18
8
votes
4 answers

How to use setx command in a windows batch file

I am trying to create a windows batch file to automatically set the environment variable to use python 2.4 or python 3.3. Both python 2.4 and 3.3 are installed on my system. Here is my code: ::To toggle between Python24 and Python 33 @echo on if…
Manmohan Singh
  • 354
  • 1
  • 2
  • 12
4
votes
2 answers

setx command not recognized on Windows10

I am installing software on a new laptop with (unfortunately) Windows 10 and the setx command is not recognized: 'setx' is not recognized as an internal or external command I have Googled this, but can't find anything related to setx and…
Plaul
  • 4,326
  • 4
  • 13
  • 18
4
votes
2 answers

How to insert a new path into system path variable if it is not already there

I'm using the below command to append a path to windows system PATH variable : setx PATH "%PATH%;%ProgramFiles%\MySQL\MySQL Server 5.5\bin" It works fine. My question is: How to append a path (%ProgramFiles%\MySQL\MySQL Server 5.5\bin in this case)…
Hamed Kamrava
  • 10,533
  • 32
  • 78
  • 117
4
votes
7 answers

setx setting PATH with spaces

I am trying to update the system Path variable in a win32 shell script but only if a value is not present. My current version looks something like this: for %%f in (xyz.exe) DO if [%%~$PATH:f]==[]; setx Path "%PATH%;%GRADLE_HOME%\bin" -m The…
Shawn Vader
  • 11,733
  • 10
  • 49
  • 60
3
votes
1 answer

Invalid syntax. Default option is not allowed more than '2' time(s)

I am having trouble understanding why I am getting this error: ERROR: Invalid syntax. Default option is not allowed more than '2' time(s). Type "SETX /?" for usage. Implementation C:\Users>setx JAVA_HOME "C:\DOC\JDK64\1.8.0.74" SUCCESS: Specified…
user
  • 688
  • 9
  • 19
3
votes
4 answers

How to change the Path variable in ant exec task?

I tried setting the Path variable in ant exec task using this link. But its not working somehow. I am trying to add THRIFT_HOME which is set to basedir currently and I have the thrift.exe file in the basedir. Also, when I change executable attribute…
TechSpellBound
  • 2,327
  • 4
  • 23
  • 36
2
votes
1 answer

"ERROR: Invalid syntax. Default option is not allowed more than '2' time(s)." using SETX

I thought I had this working at one time but recently my command quit working. My research here and abroad is not turning up anything I have not attempted already. Perhaps there is some other variable I am missing that SETX is looking at? My…
gritts
  • 145
  • 1
  • 3
  • 12
2
votes
1 answer

run setx command using java

I am writing a java code that will append a path string to the %PATH% variable using java In command prompt the command is setx PATH "%PATH%;C:\my Path\" In java here is my code: import java.io.File; import java.io.IOException; public class…
Javeria Habib
  • 467
  • 2
  • 6
  • 15
2
votes
1 answer

SETX PATH doesn't work on Windows 7 64 bit

SETX works fine in Windows 7 32 Bit but doesn't work on 64 bit. Here is my .bat file content : setx PATH "%%ProgramFiles%\MySQL\MySQL Server 5.5\bin%;" Doesn't get any error but doesn't work. But when I try this: setx PATH "%C:\Program…
Hamed Kamrava
  • 10,533
  • 32
  • 78
  • 117
1
vote
2 answers

Why use setX and setY?

OK now I know that the question seems to has an obvious answer, but really what is wrong with setX and setY functions and why won't they just work as they supposed to be. I'm trying to move views dynamically while the app is running to certain…
salRad
  • 301
  • 1
  • 6
  • 17
1
2 3