Questions tagged [setx]

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

39 questions
1
vote
0 answers

Jupyter Notebook throwing Setx Error

I opened Jupyter Notebook for the first time going to lay down some code only to be met with a password prompt. Seemed odd because I've never opened it on this PC and it doesn't prompt me for a password on my laptop. I took to the Google Machine for…
user212476
  • 11
  • 2
1
vote
1 answer

SETX with RUNAS on Windows 10 Fails

This statement fails. runas /noprofile /env /savecred /user:"Eve" setx path "%path%;D:\Program Files (x86)\metapad36" /M Works with notepad, by loading the notepad into a variable, and passing that variable to runas. But with setx, I do not…
johny why
  • 2,047
  • 7
  • 27
  • 52
1
vote
1 answer

Windows 7 batch - get last octet of IPv4 address and set environment variable

I have Windows 7 machines that get imaged, and after imaging I have to set the environment variable STATION to the last octet of the machine's IP address. How would I parse the IP address and grab the last octet to set the STATION variable? This…
1
vote
1 answer

How to restart a Java program to get environment variables active

In my swing application is a Button to set some Environment variables via setx. I have to restart the application to get the variables active. To restart the application I use the code from https://dzone.com/articles/programmatically-restart-java It…
janor
  • 179
  • 1
  • 10
1
vote
2 answers

Why does using Random() to setX() and setY() Certain devices make the view disappear?

Not sure if this has been answered. I did definitley search as hard as I could, because I feel like someone else would have had this issue. Basically I am using random along with setX and setY to move a view around randomly onClick. This works…
0
votes
0 answers

How to add MySQL Server bin path to System Path Variables using Python

I have created a automated script to install and start MySQL Server In which I have last step to add MySQL bin directory to System Variables Here is snippet of that code: try: command = f'setx PATH "%PATH%;{bin_path}"' process =…
0
votes
2 answers

take combo box choice and use choice as SETX

I have the following code to create a combo box that shows a list of ports in use on the PC What I want to do is take the users choice of port and assign it to a system variable using the SETX command. At the moment the user enters the port number…
Jud Slater
  • 21
  • 4
0
votes
1 answer

setx in Windows 10 removes backslashes

I'm trying to set my HOME path in Windows 10: setx -m HOME C:\Users\MyName Then I check the variable's value: echo %HOME% and it returns c:UsersMyName This is a pain, since I'm trying to use Git with ssh and it needs to know the home folder where…
Stromael
  • 168
  • 1
  • 9
0
votes
1 answer

How to show value created using setx in current cmd window?

I'm creating a .bat script that sets a variable using setx based on dynamic content. I would like to echo back to the user what the new value has been set to. I know from the documentation…
John
  • 3,458
  • 4
  • 33
  • 54
0
votes
1 answer

Add new directory in PATH user variable with Setx don't work

In a .bat script, I want to add a specific list of directory in PATH user variable. Initially, path is like this…
Broshet
  • 133
  • 12
0
votes
1 answer

SETX not setting system variable when using /M

I am trying to set a persistent system variable. This is for a process in which a batch file refers to the variable, and then edits the variable at the end of the process. I am using setx with the /M parameter, however, it continues to create the…
0
votes
0 answers

Setx value accepted, but not really changed

My goal is to pass to SyncBack (Pro version) a directory path to create that contains the current date&time in its name, as "D:\YYMMDD_hhmmss". The following batch file stores a variable named DateTimeCode with the formatted string, reports success…
Joe Marfice
  • 151
  • 2
  • 18
0
votes
2 answers

View.setX prevents adjustPan from working

I am programmatically setting the x value of an edittext. However, in doing so the adjust pan function does not work. Any ideas on how to make this work. The activity is not in full-screen mode and this only happens in APIs > 23. Ex. Edittext…
0
votes
2 answers

android , moving view in linearlayout

I made a linear layout and it contain some Image views . when i move one with (set X(view.get x + 10)) function, it moves... but it moves behind other views. that the view become hidden. and the other problem is when i get X & Y of the view, its…
0
votes
0 answers

Is there a way to set a Windows environment variable in the current environment?

setx does not set variables in the current environment. I want to set an environment variable and immediately use it. Can this be done? thx.