w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to ask for administrator privileges in a Windows Batch script?
Two options: Provoke elevation from a WSH script, like documented in the blog post Scripting Elevation on Vista. Use an external executable that provokes the UAC prompt, such as Elevate32.exe/Elevate64.exe. For your scenario, #2 may be preferable because you can detect whether the elevation prompt was canceled (exit code 1223) and you can also wait for the launched executable to finish before continuing (-w parameter). Bill

Categories : Batch File

7zip Self Extracting Archive (SFX) without administrator privileges
Unfortunately I have not found a way to generate SFXs using 7zip that do not require admin privileges. Having tried some other SFX generators, I stopped at IExpress that has completely satisfied my needs.

Categories : Misc

Java on Windows: Test if a Java application is run as an elevated process (with Administrator privileges)
This is what the Eclipse LocationManager does to determine if it can write to the install directory: public static boolean canWrite(File installDir) { if (installDir.canWrite() == false) return false; if (!installDir.isDirectory()) return false; File fileTest = null; try { // we use the .dll suffix to properly test on Vista virtual directories // on Vista you are not allowed to write executable files on virtual directories like "Program Files" fileTest = File.createTempFile("writtableArea", ".dll", installDir); } catch (IOException e) { //If an exception occured while trying to create the file, it means that it is not writable return false; } finally { if (fileTest != null) fileTest.delet

Categories : Java

Block pointer variable 'block' is uninitialized when captured by block
To just declare your block you would use void (^block)(void); then initialize it with block =^ // Get warning here! { next = dispatch_time(next, DELAY_IN_MS * 1000000L); // Do my periodic thing ... dispatch_after(next, dispatch_get_main_queue(), block); } That is why putting in the semicolon works. Why it gives you an error without the semicolon: you are referencing block in its own declaration/assignment. You are using it in the "dispatch_after" call, but its not fully set up yet.

Categories : IOS

What is the best way to host asp web application under Default Web Site (port 80) AND as new website (port xxxx) at the same time?
The easiest solution would be to add an binding of the default web site to the port needed. This can be done with two or three clicks in the IIS-Manager. The clean way is to use ~/ and runat="server" wherever you need a link.

Categories : C#

Autobahn Websocket: listen to local port and transfer messages to clients connected to a public port
Sure, you can run multiple services on different ports or you can run multiple services on 1 port. For the latter, see here. For the former, just create multiple factories and call listenWs multiple times.

Categories : Python

How to map public port to private port in azure Virtual Machine?
You can map ports on Windows Azure Virtual machines in the portal. Click on the virtual machine in the portal and switch to the ENDPOINTS tab, click + Add and follow the 2 step wizard adding a public and private port to use.

Categories : Azure

Convert port to :port of type string in Golang
Use strconv.Itoa() Something like: p := strconv.Itoa(port) addr := ":" + p // or for localhost only // addr := "localhost:" + p Then if err := http.ListenAndServe(addr, nil); err != nil { log.Fatal("ListenAndServe: ", err) }

Categories : Linux

Apache httpd vs. Tomcat 7: port 80 vs. port 8080
The difference is mostly historical at this point, but still enforced by Linux and most Unix implementations that I can think of. Unix/Linux considers any port number < 1024 to be "privileged" and requires root privs to bind to them. Any user should be able to bind to ports higher than 1024. If your software package is of a certain vintage it expects to be started as root, bound to a port, and optionally it will then change effective UID to a non-privileged user. Apache HTTPD falls into this category. Software packages created later on (ie Apache Tomcat) typically went the route of doing everything with a non-privileged user and binding to a higher port number by default. Some firewall admins can, I'm sure, go into detail about how port < 1024 will sometimes get special treatme

Categories : Linux

Python urllib2 exception nonnumeric port: 'port/'
The exception is thrown because you have a faulty proxy configuration. On POSIX systems, the library looks for *_proxy environment variables (upper and lowercase). For a HTTP URL, that's the http_proxy environment variable. You can verify this by looking for proxy variables: import os print {k: v for k, v in os.environ.items() if k.lower().endswith('_proxy')} Whatever value you have configured on your system is not a valid hostname and port combination and Python is choking on that.

Categories : Python

How to run "Deployd" on port 80 instead of port 5000 in webserver.
According to these docs of the internal API: http://docs.deployd.com/docs/developing-modules/internal-api/server.html You can pass in an options object when creating the server. So something like this should work var deployd = require('deployd'), options = { port : 80 }, server = deployd(options);

Categories : Node Js

listener port and serving port in server
You don't really want to limit ports as much as you want to limit threads, that's why many servers use a threadpool that contains way less threads than the amount of available ports.

Categories : Java

connect to tcp server with different port.not a port that is set.c language
The size passed to bind() is wrong. Assuming sa_loc is declared as: struct sockaddr_in sa_loc; It shall be: ret = bind(sock_descriptor, (struct sockaddr *) &sa_loc, sizeof(struct sockaddr_in)); or even better (and less error prone): ret = bind(sock_descriptor, (struct sockaddr *) &sa_loc, sizeof(sa_loc)); Btw: It's done correctly in the call to connect().

Categories : C

ssis smtp mail task /connection ,how to mention the port number if the port number is not 25
You need to configure your SmtpClient to use ssl like: mySmtpClient.EnableSsl = true this should do the trick. EDIT: To use the correct credentials use: mySmtpClient.Credentials = new System.Net.NetworkCredential("yourusername", "yourpassword")

Categories : Sql Server

Obj-C: How to make UDP packet's Source Port consistent in GCDAsyncUdpSocket? source port alway change
The reason of variable port number is I am using ARC. The instance might not be released at next time alloc and init. Everytime I call this part code I create a new GCDAsyncUdpSocket object, then try to bind the port and then send the message. These objects are being dealloced only at a later time when I use ARC. So, actually I am trying to bind to the port several times which is not possible. Once the port is bound, I cannot bind it any more.

Categories : IOS

Need to run as administrator in C# App
Add an application manifest file from project-->Add File-->Manifest and change this line as <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

Categories : C#

How to run vbs as administrator from vbs?
If UAC is enabled on the computer, something like this should work: If Not WScript.Arguments.Named.Exists("elevate") Then CreateObject("Shell.Application").ShellExecute WScript.FullName _ , WScript.ScriptFullName & " /elevate", "", "runas", 1 WScript.Quit End If 'actual code

Categories : Windows

How to use root privileges in my app
This is what I have found you must specify android.permission.FACTORY_TEST permission. docs here For accessing root permission you can use p = Runtime.getRuntime().exec("su"); Source : Here

Categories : Android

Administrative privileges
There are 2 issues with your condition $user = $false: It's not a condition in the first place. = is an assignment operator, not a comparison operator. You need -eq to check for equality. $user is not a boolean value. What you actually want to check here is the return value of the IsInRole() method. However, you never assign it to a variable, so you can't use it elsewhere in your code. Change your code to this: $user = [Security.Principal.WindowsIdentity]::GetCurrent() $isAdmin = (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) if (-not $isAdmin) { cls Write-warning "Starting and stopping services can ..." Read-host exit } and the problem will disappear.

Categories : Powershell

Run exe using Java as administrator
Please read the help of runas command. NOTE: Enter user's password only when prompted. NOTE: /profile is not compatible with /netonly. NOTE: /savecred is not compatible with /smartcard.

Categories : Java

ClearDb User Privileges
Unfortunately ClerDB does not support executement of the function with SUPER privileges. More on that you can find here: Create function without SUPER privileges.

Categories : Mysql

How to get superuser privileges in Ruby?
According to this site : http://ruby.about.com/od/rubyversionmanager/qt/Rvm-And-Sudo.htm you can start executing the script using the rvmsudo command. In your terminal window or shell script: rvmsudo ruby blockreddit.rb

Categories : Ruby

Work around lesser privileges
You can't SET GLOBAL anything without SUPER privilege. Cf. http://dev.mysql.com/doc/refman/5.6/en/set-statement.html The SUPER privilege is required to set global variables. You can't SET SESSION for this variable: mysql> SET SESSION log_bin_trust_function_creators=0; ERROR 1229 (HY000): Variable 'log_bin_trust_function_creators' is a GLOBAL variable and should be set with SET GLOBAL This is confirmed by the documentation which lists the variable as GLOBAL only, not SESSION based. So no, you can't work around this. You'll have to ask your provider to create the function for you if they don't want to give you SUPER privilege. Or else get a different hosting plan from another provider that allows you SUPER privilege. Or else don't do this calculation in an SQL stored fun

Categories : Mysql

How to gain root privileges for iOS app?
What step 4 is telling you: Open the original executable file and delete its contents (the contents are now stored in the previously copied and renamed binary). is simply that you have moved the executable file for your app to a new filename, and you should replace it with a script with the name of the original executable. Example If you build an app named HelloWorld, Xcode will create a HelloWorld.app directory, with a file named HelloWorld inside it, which is executable. The answer you link to suggests basically renaming the executable to something like MobileHelloWorld. Once you've done that, create a new file in the HelloWorld.app directory called HelloWorld, and edit it with a text editor to give it this content: #!/bin/bash dir=$(dirname "$0") exec "${dir}"/MobileHello

Categories : IOS

How does the UAC know the application is going to need elevated privileges?
How does UAC know the application is going to write to ProgramData ProgramData MIGHT be under the list of "Protected Directories" during the virtualization process of the UAC Architecture. (source needed) What can I change so that the UAC does not complain? Couple options here - It appears that you are trying to write to C:ProgramData[Company][Product] To me, this looks like a path separation issue. you are trying to create [or use] a directory named C:ProgramDataAdobePhotoshop if your application is not seperating these directories, then i'd assume that this is causing your UAC issue. try adding your path seperators. C:ProgramDataAdobePhotoshop [as an example] Disable UAC? The UAC is there to prevent unauthorized activity, and if you look at the flowchart above, any application

Categories : C#

New user has all privileges in MySQL 5.6
In many default installations, all users have all privileges on tables within any database called test or beginning with test_. From http://dev.mysql.com/doc/refman/5.6/en/default-privileges.html#idp5999952 : By default, the mysql.db table contains rows that permit access by any user to the test database and other databases with names that start with test_. ...If you want to remove any-user access to test databases, do so as follows: mysql> DELETE FROM mysql.db WHERE Db LIKE 'test%'; mysql> FLUSH PRIVILEGES; Alternatively, make sure that your test table isn't in a database with such a name, and then you'll see the true behaviour.

Categories : Mysql

How do I set Task or Thread privileges?
This COM error code has nothing to do with thread privileges, the linked article is quite wrong about that. An interface is registered in the HKLMSoftwareClassesInterface registry key. COM will look there when it needs to marshal the call from one thread to another, it needs to know what proxy is going to copy the function argument values. Which is certainly a very likely scenario in your program, the only thing we know is that you do start a thread. It seems there's something wrong with the registry on your machine. Or the COM server simply isn't registered correctly. Or the COM server just doesn't support being used from a thread. Or your program is a 32-bit process on the 64-bit version of Windows and the interface key is not present in Wow6432Node. Or the server was registered

Categories : C#

Granting privileges on MySQL
You need to flush the privileges: FLUSH PRIVILEGES; As Ricky pointed out (what is this, the mutual admiration society?!) usernames are case-sensitive, so the user Ubuntu is different from the user ubuntu

Categories : Mysql

"Standard I/O only" privileges under Windows
Since this sort of problem will be the target of some rather "bad" code in all sorts of different aspects, I would suggest that ONE possible solution is to use a virtual machine to run the "foreign" code. So, rather than building your server software that does stuff on the real hardware (and potentially messes up or takes over the machine for malicious purposes), you run the code on a virtual machine that has limited resources and strict rules. Once the "result" is complete, you shut down that VM, and start over with a "fresh" VM (created by cloning an previously constructed VM). And yes, deleting lib's and headers certainly won't stop someone from using calls/functions you don't want to be used. It will make it a tiny bit harder, but only a tiny bit. Most of the "harmful" calls are in t

Categories : C++

Show text block under an image block on clicking the image block
You want like this, check DEMO http://jsfiddle.net/yeyene/gNQVR/1/ JQUERY $('#imageDiv img').on('click', function(){ $(this).hide(); $(this).siblings('#textDiv').show(); }); $('#textDiv .close').on('click', function(){ $(this).parent('#textDiv').hide(); $(this).parent().siblings('img').show(); }); HTML <div id="imageDiv" > <img src="http://wallpaper-fullhd.com/wp-content/uploads/2013/03/at-the-beach-hd-wallpaper-1920x1200.jpg" class="close" width="200" height="200"> <div id="textDiv"> <a class="close">x</a> This is the text for the image. ...</div> </div>

Categories : Javascript

Control two websites from a Administrator
I think you should change conception of application: Seems it should be one cakephp application, Application should use cakephp themes in beforeFilter of AppController.php you should check $_SERVER['HTTP_HOST'] and use one or another theme in AppModel you can use right database config. for admin panel ( cms) seems you should use admin routing check it here

Categories : PHP

Using Xcode without Administrator access?
So is there any way I can still use Xcode ? Basically, you need to go find the administrator for the machine and ask them to allow debugging. The reason that Xcode is asking for the administrator password is that the debugger, by its very nature, needs to be able to take control of another process. That's potentially a dangerous thing to allow -- if you can debug another process, you can make it do all sorts of things. An administrator should be able to grant you access to the debugger by adding you to the _developer group. They can use this command: sudo dscl . append /Groups/_developer GroupMembership <username> where <username> is, of course, your userid. That prevents you from having to get the admin to come type their password every time you want to start using th

Categories : Xcode

CakePHP administrator routing
admin=true in a route means your url is prefixed with /admin. So in your example, your /admin route actually connects to: /admin/pages/index, and is serviced by the admin_index() action in your pages controller (as opposed to the non-prefixed index() action). You can either ensure all links to logout are created with admin=false so they map to the standard Users::logout() action, or create a new action admin_logout() which handles admin logouts. Adding manager=true to a url (along with the associated prefix setting) means the url with begin with /manager, and will map to manager_...() functions in the controller. You can use both (or more!) prefixes, but not in the same url. /pages/index maps to: PagesController:index(); /admin/pages/index maps to: PagesController:admin_index(); /ma

Categories : Cakephp

C# - cmd run as administrator but cannot execute CHKDSK
Try this: Open your Application "Manifest File". Change the element requestedExecutionLevel to: <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> I had a similar problem once ;-)

Categories : C#

Can't run vb.net application as administrator across network
Make sure that the other computers attempting to run your application have the correct .Net framework versions installed. If users are able to open the executable, there shouldn't be any other issues with permission. If you have verified the framework versions, see if there is anything in the error report that might point to a reason for the crash. A lot of times there may be something in there that can point you in the right direction.

Categories : Vb.Net

Wix Burn Bundle - Must be Administrator
You can use the bundle equivalent of launch conditions using Burn's built-in variables and WixBalExtension's Condition element: <bal:Condition Message="You can't elevate."> <![CDATA[Privileged <> 0]]> </bal:Condition> <bal:Condition Message="You're not elevated."> WixBundleElevated = 1 </bal:Condition>

Categories : Wix

Administrator permission for certain programs
The culprit is User Account Control (UAC). UAC doesn't allow white listing a particular application. You have to disable it to get rid of these messages. To know more about UAC or to diable it see http://www.petri.co.il/disable-uac-in-windows-7.htm

Categories : Misc

how to run a command as Administrator mode
I tried this code. Its working if i directly run the batch file i.e test.exe but if i configure this file into Advanced installer and run through .exe file its going into indefinite loop of terminals opening. Just add these codes at the starting of your batch file: @ECHO OFF :: BatchGotAdmin :------------------------------------- REM --> Check for permissions >nul 2>&1 "%SYSTEMROOT%system32cacls.exe" "%SYSTEMROOT%system32configsystem" REM --> If error flag set, we do not have admin. if '%errorlevel%' NEQ '0' ( echo Requesting administrative privileges... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%getadmin.vbs" echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%getadmin.vbs" "%temp%get

Categories : Postgresql

mysql root@localhost has no privileges
Well, it seems that this is your problem (emphasis mine): CONSOLE: [SEVERE] Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO) Apparently you didn't specify a password in the connection details.

Categories : Mysql

Elevating privileges of a Java process in OS X
Unfortunately it looks as if some of the AppleScript jars are not packaged with the OS X version of Java any more. Even if you can't use AppleScript directly through the Java layer any more, you could use ProcessBuilder to execute an external osascript process.

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.