CMD trouble with Windows 7 !?!

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
koleviko
Junior Coder
Posts: 45
Joined: Thu Nov 20, 2008 2:59 pm

CMD trouble with Windows 7 !?!

Post by koleviko » Mon Nov 23, 2009 1:53 pm

Administrator does not work. Access denied :evil: :evil: :evil:

Code: Select all


Let>RP_ADMIN=1 
Run Program>"cmd.exe"
WaitWindowOpen>cmd.exe*
SetFocus>C:\Windows\system32\cmd.exe
Send Character/Text>net stop "Spooler"
wait>0.3
press enter




Second problem.

Does not work in hidden mode .

Code: Select all


Let>RP_WINDOWMODE=0
Run Program>"cmd.exe"
WaitWindowOpen>cmd.exe*
Send Character/Text>start c:\mypic.jpg
wait>0.3
press enter


:( :( :(

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

Post by Marcus Tettmar » Mon Nov 23, 2009 2:45 pm

1. If a process is not admin it cannot interract with a process that is admin. So in your first macro you start an admin process but won't be allowed to send keystrokes to it. Solution: Run Macro Scheduler as admin (or, better, compile to an EXE and only run the EXE as admin)

2. You cannot send keystrokes to an invisible window. We can do some amazing things but altering the laws of physics is not yet one of them.

What you CAN do however is:

Let>RP_ADMIN=1
Let>RP_WINDOWMODE=0
Run>net stop "Spooler"

Or:

Let>RP_WINDOMODE=0
Run>cmd.exe /c "some dos command here"

In short, you do not need to send keystrokes to a command window to issue a command.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

koleviko
Junior Coder
Posts: 45
Joined: Thu Nov 20, 2008 2:59 pm

Post by koleviko » Mon Nov 23, 2009 3:40 pm

Deliveries via FTP but they are blocked by UAC.
The program must include itself automatically and allows administrator access, but I can not run it manually.
Must disable UAC and then transfer the files to activate it again.
But how to do this with MacroScheduler.


So do not want to confirm the window too.
And I do not want to completely exclude UAC to run Macro, I feel it useful.

Code: Select all


Let>RP_ADMIN=1
Run Program>"cmd.exe"
Wait>1
Press tab 3*
wait>0.5
press Enter




The new laws of physics!

Image

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

Post by Marcus Tettmar » Mon Nov 23, 2009 3:46 pm

So, if you cannot disable UAC then I think you need to create a macro, compile it and then run that macro as admin so that it has admin rights and can interact with admin processes.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

koleviko
Junior Coder
Posts: 45
Joined: Thu Nov 20, 2008 2:59 pm

Post by koleviko » Mon Nov 23, 2009 4:11 pm

Yes but I want this to happen automatically.
Macro to run only with administrator rights when I'm not at home.
Is it possible to ever happen automatically when switched UAC?!?
If you could give me an example script? :shock:

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

Post by Marcus Tettmar » Mon Nov 23, 2009 4:20 pm

If you have UAC enabled then anything that requires admin rights will pop up a UAC prompt. Macro or no macro. In other words, no, you cannot prevent a UAC window popping up unless you disable UAC. I suppose one other option is that you run Macro Scheduler (or a .exe) as admin on startup. It will then cause a UAC prompt on startup, but as long as you don't quit Macro Scheduler or reboot it will not cause any further prompts and can therefore run unattended.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

koleviko
Junior Coder
Posts: 45
Joined: Thu Nov 20, 2008 2:59 pm

Post by koleviko » Mon Nov 23, 2009 4:38 pm

I understand :cry:
You'll have to manually turn off UAC in MacroScheduler can not.
Too bad I like UAC. :cry:

However, thank you for explanations . :wink:

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Tue Nov 24, 2009 2:11 am

Warning!

Clicking on the image posted above under "new laws of physics" sets off alarms in NOD32 Antivirus and then loads a strange page for me.

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

Post by idiot » Fri Nov 27, 2009 2:57 am

deleted sorry
Last edited by idiot on Sat Nov 28, 2009 8:54 pm, edited 2 times in total.
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

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

Post by Marcus Tettmar » Fri Nov 27, 2009 9:10 am

Idiot,

Erm, WPePro is a TCP packet editor/sniffer. The OP didn't mention anything about this being a network process. Secondly, even if it was, with UAC enabled Windows is not going to let a non-admin process interfere with an admin one anyway, so the original issue still applies. Thirdly he was talking about needing to send keystrokes to the window. I don't see anything in his posts that suggests that manipulating network data packets will have the same effect as manipulating the UI.

Also this is not a hackers forum, it's a forum for helping people with Macro Scheduler. Oh and just because I don't choose to talk about something doesn't mean I don't know about it. If I have cause to believe people are discussing illegal uses for the software I will have no hesitation in deleting their posts.

P.S could you *please* find the punctuation keys on your keyboard because it is *really* hard to read your posts. Just a full stop now and then would be nice. Thank you. :-)
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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