Run as...
Moderators: Dorian (MJT support), JRL
Run as...
In Windows XP and 2000 there is the option to right click on an executable and "run it" in a different domain.
example: I'm logged onto Domain "ABC" but need to run "X" application in Domain "123" as I have rights to certain directories.
I would right click on the executable, select "Run as..." and then enter the Domain/User ID/password to run it.
How can I reproduce this in Macro Scheduler? any ideas?
example: I'm logged onto Domain "ABC" but need to run "X" application in Domain "123" as I have rights to certain directories.
I would right click on the executable, select "Run as..." and then enter the Domain/User ID/password to run it.
How can I reproduce this in Macro Scheduler? any ideas?
Run as...
Hi,
have you tried to "record" (an MSched option), what you would manualy do ???
The "recorded" script could be something like this (reduced of multiple Wait(s)>)
Cause i'm not working with XP/2000 I can't check it, sorry.
Ciao Ernest
have you tried to "record" (an MSched option), what you would manualy do ???
The "recorded" script could be something like this (reduced of multiple Wait(s)>)
Code: Select all
MouseMove>screen position of the application
Press RWinKey
Send>Letter assigned to the "run as" -option
Send>Domain/User ID/password
Press Enter
Ciao Ernest
Hi,
The easiest way to do this is to create a shortcut for the application you want to run and set the Run As credentials in the advanced settings. Then just execute this shortcut with Macro Scheduler using the ExecuteFile command:
ExecuteFile>myshortcut.lnk
The easiest way to do this is to create a shortcut for the application you want to run and set the Run As credentials in the advanced settings. Then just execute this shortcut with Macro Scheduler using the ExecuteFile command:
ExecuteFile>myshortcut.lnk
MJT Net Support
[email protected]
[email protected]
Run as...
I hope I'm right about this, but on my Windows XP machine, the procedure suggested above would merely activate a Run As [i][b]prompt[/b][/i], which would come up after you execute the shortcut. To achieve the Run As, you would have to add script commands that look for and fill out that subsequent prompt. Perhaps something along the lines of the following would work:
ExecuteFile>myshortcut.lnk
WaitWindowOpen>Run As
Wait>0.05
SetFocus>Run As
Press ALT
Send Character/Text>f
Release ALT
Wait>0.1
Send Character/Text>PCNAME\USERID
Press TAB
Send Character/Text>PASSWORD
Wait>0.1
PushButton>Run As,OK
For info on encrypting your macro to hide the password info in the above script, see the encryption tab in the macro's window and/or search elsewhere in these forums.
--S
ExecuteFile>myshortcut.lnk
WaitWindowOpen>Run As
Wait>0.05
SetFocus>Run As
Press ALT
Send Character/Text>f
Release ALT
Wait>0.1
Send Character/Text>PCNAME\USERID
Press TAB
Send Character/Text>PASSWORD
Wait>0.1
PushButton>Run As,OK
For info on encrypting your macro to hide the password info in the above script, see the encryption tab in the macro's window and/or search elsewhere in these forums.
--S
Run as...
Sorry, it turns out that, on my XP machine, the script I just ventured above will NOT work. The "Run As" window, when it is pulled up through a script (as opposed to being pulled up manually by the user launching a shortcut or right-clicking on an appilcation) locks up Macro Scheduler, preventing it from executing any more commands.
If the Administrator / Moderator has any suggestions regarding how to implement his suggested "Run As" procedure in Windows XP, I'd be grateful to know about them. Thanks!
--S
If the Administrator / Moderator has any suggestions regarding how to implement his suggested "Run As" procedure in Windows XP, I'd be grateful to know about them. Thanks!
--S
Run as...
Pending any more elegant a method, I tinkered around and found the following, different method works for me. Below, [FOLDERNAME] is the name of the folder containing the TARGET executable or shortcut you'd like to launch. It might be best to make it a shortcut and to add a couple of unusual letters to the beginning of its name, such as "zz".
ExecuteFile>[path to FOLDERNAME]
WaitWindowOpen>[FOLDERNAME]
Wait>0.05
SetFocus>[FOLDERNAME]
Wait>0.5
Let>SK_DELAY=200
Send Character/Text>[unusual first letters of TARGET name]
Let>SK_DELAY=[0 or WHATEVER IT WAS BEFORE]
Wait>0.3
Press SHIFT
Press F10
Release SHIFT
Wait>0.1
Send Character/Text>u
WaitWindowOpen>Run As
Wait>0.05
SetFocus>Run As
Wait>0.5
Press ALT
Send Character/Text>f
Release ALT
Wait>0.5
Send Character/Text>[COMPUTER NAME]\[USER NAME]
Press TAB
Send Character/Text>[PASSWORD]
Wait>0.5
PushButton>Run As,OK
Wait>1
SetFocus>[FOLDERNAME]
Wait>0.1
Press CTRL
Send Character/Text>w
Release CTRL
Very inelegant, but it works for me. You may need to adjust the durations of the Wait commands and SK_DELAY variable to suit your computer.
--S
ExecuteFile>[path to FOLDERNAME]
WaitWindowOpen>[FOLDERNAME]
Wait>0.05
SetFocus>[FOLDERNAME]
Wait>0.5
Let>SK_DELAY=200
Send Character/Text>[unusual first letters of TARGET name]
Let>SK_DELAY=[0 or WHATEVER IT WAS BEFORE]
Wait>0.3
Press SHIFT
Press F10
Release SHIFT
Wait>0.1
Send Character/Text>u
WaitWindowOpen>Run As
Wait>0.05
SetFocus>Run As
Wait>0.5
Press ALT
Send Character/Text>f
Release ALT
Wait>0.5
Send Character/Text>[COMPUTER NAME]\[USER NAME]
Press TAB
Send Character/Text>[PASSWORD]
Wait>0.5
PushButton>Run As,OK
Wait>1
SetFocus>[FOLDERNAME]
Wait>0.1
Press CTRL
Send Character/Text>w
Release CTRL
Very inelegant, but it works for me. You may need to adjust the durations of the Wait commands and SK_DELAY variable to suit your computer.
--S
Why not just use the runas command. Go to a dos prompt and type runas /?
Run>runas /env /user:Username d:\test.exe
Wait>1
Send>Password
Press Enter
Run>runas /env /user:Username d:\test.exe
Wait>1
Send>Password
Press Enter
MJT Net Support
[email protected]
[email protected]
Run as...
Thanks, that sounds great, in general. Sadly, in my case, I'm interested in running the disk defragmenter, and command-line operation of the system's disk defragmenter (dfrg.mcs or its related executables) is not supported under Win XP. (I can't launch the defragmenter using a command-line either manually or via a Macro Scheduler script.)
So, now at least we all have two options---your elegant one for most programs and my heavy-handed one for the few programs that don't support command-line operation.
Thanks again.
--S
So, now at least we all have two options---your elegant one for most programs and my heavy-handed one for the few programs that don't support command-line operation.
Thanks again.
--S
What's wrong with this then:
Run>runas /env /user:Username "mmc c:\windows\system32\dfrg.msc"
Wait>1
Send>Password
Press Enter
Run>runas /env /user:Username "mmc c:\windows\system32\dfrg.msc"
Wait>1
Send>Password
Press Enter
MJT Net Support
[email protected]
[email protected]