B
bxb7668
I have a number of Perl scripts that I often have to execute as a
different userid. Up to now I open a command prompt and launch the
script using the runas command.
I would like to be able to add an item to the Windows context menu for
items with a .pl extension to automatically launch the script using
runas. I've created the menu entry as:
%windir%\system32\runas.exe /user:nw\myuserid "cmd /k
C:\Perl\bin\perl.exe %1" %*
This doesn't work. It gives me an error message of:
C:\cc_trigs\thescript.pl
Access is denied
If I right-click and select the default Open, the script runs just
fine.
Another problem with runas when I use it from the command line is that
it doesn't remember drives that I've already mapped. I'm guessing that
this is because the runas userid hasn't been authenticated. To get the
mapped drive to work I must use the "net use P: \\server\share"
command to make it available. I assume that to get the context menu to
work, the target Perl script must either be on my local drive or I
must include the "net use" command as part of the command string.
Can anyone help me with these issues?
Thank you
Brian
different userid. Up to now I open a command prompt and launch the
script using the runas command.
I would like to be able to add an item to the Windows context menu for
items with a .pl extension to automatically launch the script using
runas. I've created the menu entry as:
%windir%\system32\runas.exe /user:nw\myuserid "cmd /k
C:\Perl\bin\perl.exe %1" %*
This doesn't work. It gives me an error message of:
C:\cc_trigs\thescript.pl
Access is denied
If I right-click and select the default Open, the script runs just
fine.
Another problem with runas when I use it from the command line is that
it doesn't remember drives that I've already mapped. I'm guessing that
this is because the runas userid hasn't been authenticated. To get the
mapped drive to work I must use the "net use P: \\server\share"
command to make it available. I assume that to get the context menu to
work, the target Perl script must either be on my local drive or I
must include the "net use" command as part of the command string.
Can anyone help me with these issues?
Thank you
Brian