%PATH% variable of a remote machine?
#1
Posted 22 June 2009 - 08:16 PM
And a follow up for extra points... Windows 2000/2003, anyone know a magical way to "fix" the upper limit of 1024 characters in the path? (Again, in a manner that would suit bulk maintenance instead of one at a time clickey-clicking.)
If anyone can provide a decent answer/solution for either or both questions, I will officially drink a beer in your honor.
#2
Posted 23 June 2009 - 02:56 AM
Edited by jabzor, 18 July 2009 - 10:03 AM.
#3
Posted 23 June 2009 - 10:35 PM
But show me a way to do that on a remote box besides logging on and opening a command prompt. :)
#4
Posted 24 June 2009 - 12:50 AM
http://technet.micro...s/bb897553.aspx
You should be able to connect to other machines and execute "set %path%". Yes, it's a third party app but you only need to install it on the machine acting as the server.
Edited by mecca_, 24 June 2009 - 12:52 AM.
#5
Posted 24 June 2009 - 03:41 PM
Problem is that it wants to expand the variable locally before passing it to the remote system.
Today I actually did find the registry key where the Path variable is stored, which is much easier to get at remotely.
#6
Posted 24 June 2009 - 03:52 PM
#7
Posted 24 June 2009 - 11:07 PM
#8
Posted 13 July 2009 - 11:59 AM
Yeah, I didn't mention. This is in a domain, and I am using an account with domain admin rights. (And, thus, local admin on the box itself.)
Im not a coder, so this might be a bit too ugly for what you're trying to accomplish.
Could you have a startup script that runs "echo %path% >> path.txt" and have your script read the file? Or maybe have it save the output to a share on the server the script is running on?
#9
Posted 13 July 2009 - 09:59 PM
Also, that's not very bulk-friendly since I would have thousands of files to sift through. I have found a workaround that gives me what I need... it doesn't look like there's an in-built way to get at it with 2000/2003. :(
#10
Posted 13 July 2009 - 10:36 PM
if you have a network machine/drive you could just useProblem with a startup script would be the need to restart the server.
![]()
Also, that's not very bulk-friendly since I would have thousands of files to sift through. I have found a workaround that gives me what I need... it doesn't look like there's an in-built way to get at it with 2000/2003.![]()
echo %computername% >> (whatever you want).txt echo %path% >> (whatever you want).txt echo "" >> (whatever you want).txtthen it wont over write the file so it will just be one giant file with all of the paths like
blah1 c:\windows\ blah2 c:\windows\ ect.and im guessing they arent your machines as idk anyone that owns thousands of computers but a startup scirpt would work just add a line to delete it after it runs so they dont notice it. eventually probably a couple days you'll get all of them(the path variables). problem would be restarting/getting it on all of the machines you want to see the path on. but with set it would just rewrite the file, with echo it would just write to the file like a log.
o well you figured it out and what not.
Edited by dinscurge, 13 July 2009 - 10:36 PM.
#11
Posted 14 July 2009 - 10:53 PM
Welcome to the Big Leagues. This is for my job, where I am in fact a part of a team that maintains several thousand servers. And, in fact, the company I work for is probably midsized technology-wise compared to some of the big behemoths out there (how many servers do you think IBM, Google, or Microsoft have running?).and im guessing they arent your machines as idk anyone that owns thousands of computers
Well, again... these are servers, so they don't just restart every single day. In fact, it would be a Very Bad Thing if some of them did. There are some that only reboot 3 or 4 times a year under highly controlled conditions.but a startup scirpt would work just add a line to delete it after it runs so they dont notice it. eventually probably a couple days you'll get all of them(the path variables).
Also when considering servers (as opposed to desktop/workstation PCs), a startup script is not a reliable means to execute something since an interactive logon may happen rarely, if ever. We do have a tool that allows us to run arbitrary commands on-demand, so that part isn't an issue. (It was just a problem with getting the remote value locally.)
The network share idea is decent, but the problem there is that the network is so segmented there is no way to guarantee that our internal firewalls will allow Windows filesharing traffic from any given point to any other given point on the network.
Enterprise-level network administration is a peculiar beast; a lot of the conventional wisdom or best-practice guidelines either can't be practically adhered to or were beat down by middle and upper management politicking. It is a fascinating world for someone like me, who cut his teeth on smaller Mom and Pop type networks. :)
#12
Posted 14 July 2009 - 11:04 PM
edit: it also didnt help i thought you were trying to get the path variable of a bunch of computers using your domain not the servers..
Edited by dinscurge, 14 July 2009 - 11:05 PM.
#13
Posted 14 July 2009 - 11:25 PM
Well, no... it depends on what is installed on each one.the same machines/models should all have the same path.
#14
Posted 14 July 2009 - 11:28 PM
yeah. guess you have a hodgepodge of machines with different hardware/os's.Well, no... it depends on what is installed on each one.the same machines/models should all have the same path.
BinRev is hosted by the great people at Lunarpages!













