Sign in to follow this  
Followers 0
MrEd

-1 Invalid Directory when RunAsSet

1 post in this topic

Just when I thought I had the RunAsSet figured out...

I am receiving the dreaded

Line -1:

Error: Unable to execute the external program

The directory name is invalid

Here is the code

If FileExists(@StartupCommonDir & "\Windows Desktop Search.lnk") Then
    $fileToDelete = @StartupCommonDir & "\Windows Desktop Search.lnk"
    RunAsSet("Administrator",@ComputerName,"password",0)
    Run(@ComSpec & " /c " & "del "  '"' & $fileToDelete & '"', "", @SW_HIDE)
EndIf

I first tried fileDelete(), then without the variable by building the path to the file on the run line and finally tried making the path to the file a variable.

Why Microsoft thought their search bar was a critical update is beyond my be the users are screaming.

Thanks for any assistance.

BTW I have figured out the RunAsSet for installing files from a network share. I will be searching for my original post and adding what I came up with.

Mr Ed

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