Page 1 of 1 1
Topic Options
#211925 - 2016-08-31 11:12 PM Run "regedit.exe" in Windows 10
MSC Offline
Just in Town

Registered: 2008-01-30
Posts: 1
Hello!

I'm testing an existing Kix script on Windows 10. Everything works fine, on Windows 7, but the following line does not actually do anything, for some reason, when run on Windows 10. Logged on user is in the Administrators group and UAC is off.

Run "regedit /s " + Chr(34) + "\\fs1\solidedge$\CurrentVersion\64-bit\Addins\Cideon\CurrentRelease\Custom\Registry\RemoveSettings.reg" + Chr(34)

I've even tried to just get the script to open regedit.exe, without success. I can get it to open notepad.exe, without issue. I also tried with the reg file on my hard drive, instead of the network, but still no success.

Any assistance will be greatly appreciated. Thanks.

MSC

Top
#211926 - 2016-09-01 12:23 AM Re: Run "regedit.exe" in Windows 10 [Re: MSC]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
Open the cmd.exe with "Run as Administrator" and it will likely work. MS and their bs restrictions.

You are likely going to have to find another way. What is the contents of the reg file? Very likely it can be done right in kixtart with writevalue(), etc.
_________________________
(... better days ahead)

Top
#211928 - 2016-09-01 01:56 PM Re: Run "regedit.exe" in Windows 10 [Re: Allen]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Don't forget about PSExec.exe - without credentials it runs as SYSTEM, which usually has the rights you need. This does assume you're starting the process as a member of the administrators group.

Something like
 Code:
Shell 'psexec.exe -s kix32.exe myscript.kix'
You might also try "-h" to run with the elevated token instead of "-s". Note that PSExec running as System won't have network access, so you might want to first copy the .REG file to the local temp folder and reference it from there instead of the UNC location.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#211934 - 2016-09-02 10:47 AM Re: Run "regedit.exe" in Windows 10 [Re: Glenn Barnas]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
my psexec lines doing stuff remotely on any Windows platform we have (including the latest), look like this recently:

 Code:
            $result = WshPipe($psexec + $s + ' -u ' + $rA + ' -p ' + $rP + ' -h -s -accepteula ' + $c[$e], 1)
            $result = join($result, @crlf)

where WshPipe is a stripped version of the originals to be found in the UDF Library section...
$psexec represents the path to the executable in my folder structure
$s is of course the remote system name or IP address
$rA is the account that has elevated rights on the remote (normally I use different ones encrypted locally to try from least privileged to most)
$rP will be the corresponding password (a bit unsafe to do so I guess)
$c[$e] is, in this case I copied from, the current command to execute remotely in my loop..
, 1) is to let WshPipe not echoing.. who needs consoles to pop up anyway \:\)

In retrospective.. psexec is a tool I love. Thanks Mark R. \:D

_________________________



Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1383 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.055 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org