Comments (9)
might it be of any help,
https://github.com/ChristopherHaws/node-windows-elevate
https://github.com/mh-cbon/aghfabsowecwn
from node-windows.
Yes, I believe it's a silent command in its current form. I don't have time to test it, but I believe a few minor changes to bin/elevate/elevate.vbs
will provide the output you're looking for. Specifically, using CScript
instead of WScript
. I honestly don't remember why I didn't do this in the original version, but here is what I think it would need to look like:
Set Shell = CreateObject("Shell.Application")
Set WShell = CScript.CreateObject("CScript.Shell")
Set ProcEnv = WShell.Environment("PROCESS")
cmd = ProcEnv("CMD")
app = ProcEnv("APP")
args= Right(cmd,(Len(cmd)-Len(app)))
If (CScript.Arguments.Count >= 1) Then
Shell.ShellExecute app, args, "", "runas", 0
Else
CScript.Quit
End If
Please let me know if that helps, and I'm sorry I can't test things out right now.
from node-windows.
Hey, thanks for checking it out. I tried that but I get the error Object required: 'CScript'
. I researched this a bit and got as far as changing start wscript
to start cscript
in elevate.cmd
, but that just popped up a console window briefly and didn't actually elevate the command.
I'm not really familiar with Windows scripting (aside from batch files...) so I'm unsure what to try next, but if you want me to check something out I'd be glad to. This also isn't a critical bug for me right now, so no big deal if it sits around a while. Thanks again for the great tool.
from node-windows.
Having the same issue here. I can't tell if the elevation was successful or not (error
is null in any case), or if the child process was successful or not (not sure if there is something analogous to UNIX error codes on Windows).
Is this feasible? I have no experience on Windows system myself to work on this.
from node-windows.
@coreybutler I've been trying to get your suggestion working. I made use of CScript
along the code and call it with start cscript
as @endquote suggestion.
The following line turned out to be problematic:
Set WShell = CScript.CreateObject("CScript.Shell")
and it returned an error that said: "Microsoft VBScript runtime error: Object required: "CScript"" (the error is shown in a terminal instance that is shown for a few milliseconds, so I had to film to screen and pick the right frame in order to see it, but there is still a missing part of the error that is not visible due to the small terminal size).
After some googling, I replaced CScript.CreateObject
with simply CreateObject
, but I now get the following error:
Microsoft VBScript runtime error: ActiveX component can't create object: 'CScript.Shell'.
I'd appreciate is someone with experience on this can provide some feedback.
from node-windows.
@jviotti - which version of Windows are you running this on?
I haven't had much time for fixes on this project recently and have been re-evaluating the elevation process for the next version.
from node-windows.
@coreybutler I'm running Windows 8.1, please let me know of any news regarding this issue.
from node-windows.
@coreybutler first of al, thanks for this module, it's very neat 👍
+1 from me, would be really cool if I could tell if the elevation succeded.
AFAIU what happens now is if the user clicks 'no' in UAC prompt, Windows will do some some kind of emulation pretending that it can write to disk (this is my use case) but will not really do it - will not throw any EPERM errors as would happen when running without elevation, which can be a bit misleading.
(my use case for the usage of this module is creating symlinks which apparently is impossible from regular non-elevated node scripts)
from node-windows.
elevate()
pops up tha UAC but doesn't do anything other than that. Win10 @32bit
from node-windows.
Related Issues (20)
- Needs windows restart before creating service HOT 1
- 03/30/2023: Please release a non-beta version HOT 2
- node-windows with babel and pkg HOT 1
- Question: Is it possible to split .exe creation and service creation HOT 1
- Comments in the XML file break the service executable
- Unsupported node: v19.0.0 HOT 1
- Event Logging other than event id 1000 HOT 7
- File path HOT 2
- 2023-07-13: React functionality HOT 1
- I need the source code for the binary files under "/bin" HOT 2
- Error while creating daemon folder: daemon already exists HOT 1
- [20231213]: Windows DNS integration HOT 2
- Noticed Typo in the documentation
- logpath property is not working HOT 2
- is it possible to have exe name different than the service name ?
- Why do we need to install it globally?
- March 6 2024 - Does this work with run-p
- Unable to execute child process HOT 1
- Each service is creating 2 seperate node processes HOT 4
- CPU overload due to wrapper launching new Node processes when an unhandled error occurs HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-windows.