Runas dialog stops script execution

2

I have installed Nmap 6.25 and Python 3.3 in my Windows XP SP3 machine. I have written a python script that calls Nmap and writes its output in a file. I have placed the script's shortcut in the Allusers startup folder. When i log in as administrator, the script executes normally. When i log in as a normal user, i can see Nmap starting in the console window but then I get the Runas dialog and nothing gets done unless i manually press OK.

I have disabled the Secondary Logon service but i still get the Runas dialog. Something that puzzles me is that when i re-run the script (as a normal user), no Runas dialog appears and the script executes normally.

Any suggestions on how i can make the Runas dialog disappear on startup?

EDIT [SOLVED]:

Microsoft's way did not disable RunAs in my system.

SOLUTION #1:

First of all, there was no Security tab when i right clicked a file to inspect file permissions. This was because my pc belonged to a workgroup. Following Microsoft's directions i enabled the Security tab:

1. Click Start, and then click Control Panel.
2. Click Appearance and Themes, and then click Folder Options.
3. Click the View tab, and then click to clear the Use simple file 
sharing [Recommended] check box in the Advanced settings box. 

Since the RunAs dialog appeared after the execution of the python script and before the execution of nmap, it was obvious that nmap was the culprit. So, i changed the file permitions of "C:\Program files\Nmap\Nmap.exe" so that the specific user could execute it.

DONE!

Many thanks to Lizz for pointing out the obvious thing that i failed to see.

SOLUTION #2: (Recommended)

Instead of fighting with file permissions, remove shortcut to script from startup folder. Open the console and type:

gpedit.msc

Go to Computer Configuration -> Windows Settings -> Scripts (Startup/Shutdown).

In the details pane, double-click Startup.

In the Startup Properties dialog box, click Add.

In the Add a Script dialog box:

Script Name: c:\pythonXX\python.exe
Script Parameters: c:\path\to\python\script

Replace pythonXX with the version of python you are using.

Click OK. DONE!

Don Juan dePython

Posted 2013-03-14T09:12:53.660

Reputation: 184

I'm guessing the shortcut you created in the startup folder was drag'n'drop from the actual script? If so, then I would suggest making a small batch script in the startup folder instead. – Lizz – 2013-03-21T04:07:33.300

I did the batch script approach but it did not change anything. The RunAs dialog still appears. – Don Juan dePython – 2013-03-26T17:02:38.987

Dumb question: what are the permissions on the shortcut or small batch script? Does it give Users the right to Read & Execute? to Change? If not, then add it and try again. Also, check rights on the NMAP files & folder - same w/Python. – Lizz – 2013-03-27T01:50:48.750

Dumb answer: File permissions. Should have checked that first. See edit in OP. – Don Juan dePython – 2013-03-27T08:59:58.360

Answers

1

Per our exchange in comments, Don found the solution was permissions on the NMAP folder. These are the steps he went through, as copied from his edited question, above. Good job, Don. :)


Microsoft's way did not disable RunAs in his system.

There was no Security tab when right clicking a file to inspect file permissions. This was because [your] pc belonged to a workgroup. Following Microsoft's directions, [you] enabled the Security tab:

  1. Click Start, and then click Control Panel.
  2. Click Appearance and Themes, and then click Folder Options.
  3. Click the View tab, and then click to clear the Use simple file sharing [Recommended] check box in the Advanced settings box.

Since the RunAs dialog appeared after the execution of the python script and before the execution of nmap, it was obvious that nmap was the culprit. So, [he] changed the file permissions of "C:\Program files\Nmap\Nmap.exe" so that the specific user could execute it.

Lizz

Posted 2013-03-14T09:12:53.660

Reputation: 220