Net View Access Denied

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Net View Access Denied

Post by JRL » Mon Feb 16, 2015 6:25 pm

I have a script that has a line that fails to work on 64 bit Windows 7 that used to work on WinXP. The line that fails is:

RunProgram>cmd /c net view /domain:engineering > %temp_dir%EngTest.txt

I have 2 workgroups and two domains. I use "net view" with each of them to create a list of all the computers on my network. I have four RunProgram> lines identical to the one above except that they each have a different domain or workgroup name. The other three lines work fine this one line does not. It gives an "Access denied" error.


On the same Win7 computer.
Running "net view /domain:engineering" from a DOS prompt works fine.

Running "net view /domain:engineering" from "Start" > "Search Programs and Files" works fine.

I tried putting the line in a batch file and running the batch file. Again it works every way I run it except from Macro Scheduler RunProgram> and ExecuteFile>

I tried putting Let>RP_Admin=1 ahead of the RunProgram> line and it still fails.

Any suggestions welcome.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Net View Access Denied

Post by Marcus Tettmar » Tue Feb 17, 2015 9:29 am

Macro Scheduler will be running the 32 bit version of cmd.exe and in turn it is running the 32 bit command. Try this:

RunProgram>%SYS_NATIVE%\cmd /c net view /domain:engineering > %temp_dir%EngTest.txt

You may also need RP_ADMIN if it's an admin thing or run Macro Scheduler/the macro as admin first.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Net View Access Denied

Post by JRL » Tue Feb 17, 2015 1:49 pm

SYS_NATIVE did the trick.

Thank you very much.
Dick

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts