Sign in to follow this  
Followers 0
kenz

Simple script but can't figure out what's wrong

5 posts in this topic

This is a simple script that prompts for a userid and password to use in a runas to launch a batch file. When I try it I get the following. The path is fine. Any ideas why this doesn't work? Thanks.

Unable to execute the external program.:

Run("o:\programs\sql\oneid.bat", "", @SW_MAXIMIZE)

The system cannot find the path specified.

$user = InputBox("Security Check", "Enter your USERID.", "")
 $password = InputBox("Security Check", "Enter your password.", "", "*")
   
    Local $domain = 'RB'
    
   RunAsSet($user, $domain, $password)
    Run("o:\programs\sql\oneid.bat", "", @SW_MAXIMIZE)
        RunAsSet()

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This is a simple script that prompts for a userid and password to use in a runas to launch a batch file. When I try it I get the following. The path is fine. Any ideas why this doesn't work? Thanks.

Unable to execute the external program.:

Run("o:\programs\sql\oneid.bat", "", @SW_MAXIMIZE)

The system cannot find the path specified.

$user = InputBox("Security Check", "Enter your USERID.", "")
 $password = InputBox("Security Check", "Enter your password.", "", "*")
   
    Local $domain = 'RB'
    
   RunAsSet($user, $domain, $password)
    Run("o:\programs\sql\oneid.bat", "", @SW_MAXIMIZE)
        RunAsSet()
looks like your using a mapped drive

The account trying to access it does not have it mapped (Admin account).

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

looks like your using a mapped drive

The account trying to access it does not have it mapped (Admin account).

I tried using UNC and I get the following error. that's why I tried a mapped drive.

Unable to execute the external program.:

Run("\\d2pvs12\d142\d1group\d127\programs\sql\oneid.bat", "", @SW_MAXIMIZE)

The parameter is incorrect.

$user = InputBox("Security Check", "Enter your USERID.", "")
 $password = InputBox("Security Check", "Enter your password.", "", "*")
   
    Local $domain = 'RB'
    
   RunAsSet($user, $domain, $password)
    Run("\\d2pvs12\d142\d1group\d127\programs\sql\oneid.bat", "", @SW_MAXIMIZE)
        RunAsSet()

Share this post


Link to post
Share on other sites

I tried using UNC and I get the following error. that's why I tried a mapped drive.

Unable to execute the external program.:

Run("\\d2pvs12\d142\d1group\d127\programs\sql\oneid.bat", "", @SW_MAXIMIZE)

The parameter is incorrect.

$user = InputBox("Security Check", "Enter your USERID.", "")
 $password = InputBox("Security Check", "Enter your password.", "", "*")
   
    Local $domain = 'RB'
    
   RunAsSet($user, $domain, $password)
    Run("\\d2pvs12\d142\d1group\d127\programs\sql\oneid.bat", "", @SW_MAXIMIZE)
        RunAsSet()
try:

Run(@ComSpec & " /c \\d2pvs12\d142\d1group\d127\programs\sql\oneid.bat", "", @SW_MAXIMIZE)

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

try:

Run(@ComSpec & " /c \\d2pvs12\d142\d1group\d127\programs\sql\oneid.bat", "", @SW_MAXIMIZE)

Ok now I get a DOS window that says CMD.exe was started in the following path. UNC paths are not supported. Defaulting to windows directory

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0