Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.scripting.vbscript > #12064

Re: ShellExecute with "RunAs" verb ignores the working directory argument

From "Mayayana" <mayayana@invalid.nospam>
Newsgroups microsoft.public.scripting.vbscript
Subject Re: ShellExecute with "RunAs" verb ignores the working directory argument
Date 2019-03-20 13:45 -0400
Organization A noiseless patient Spider
Message-ID <q6tuah$n9$1@dont-email.me> (permalink)
References <158t4z9xz8rj1.18ijto36bnr3g$.dlg@40tude.net>

Show all headers | View raw


"JJ" <jj4public@vfemail.net> wrote

| Meaning that the "RunAs" verb did ignored or messed up the given working
| directory. FYI, if the Command Prompt is already elevated, everything 
works
| fine. So is there a solution other than manually readjusting the working
| directory?

   Just guessing as I'm not on a restricted system. My
first guess would be that, of course, why should it
cooperate with a programmatic attempt to elevate?
That would defeat the purpose of restrcitions.

  My second guess is... what? I can't find ShellExecute
as being available either in the WSH docs or in Win7
MSDN for the Shell object. I've only seen it as an
API call. Nor do I see it in the typelib on XP.

  This is a longshot, but you might test this:

MsgBox WScript.ScriptFullName
Set SH = CreateObject("WScript.Shell")
MsgBox sh.CurrentDirectory
Set sh = Nothing

   That will not always return the same path for both. The
first is the path of the script. The second can vary. You
may be getting the path of cscript parent folder.

Back to microsoft.public.scripting.vbscript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

ShellExecute with "RunAs" verb ignores the working directory argument JJ <jj4public@vfemail.net> - 2019-03-20 21:31 +0700
  Re: ShellExecute with "RunAs" verb ignores the working directory argument "Mayayana" <mayayana@invalid.nospam> - 2019-03-20 13:45 -0400
    Re: ShellExecute with "RunAs" verb ignores the working directory argument JJ <jj4public@vfemail.net> - 2019-03-21 21:48 +0700
      Re: ShellExecute with "RunAs" verb ignores the working directory argument "Mayayana" <mayayana@invalid.nospam> - 2019-03-21 11:34 -0400
        Re: ShellExecute with "RunAs" verb ignores the working directory argument JJ <jj4public@vfemail.net> - 2019-03-23 11:11 +0700
          Re: ShellExecute with "RunAs" verb ignores the working directory argument "Mayayana" <mayayana@invalid.nospam> - 2019-03-23 09:27 -0400
            Re: ShellExecute with "RunAs" verb ignores the working directory argument JJ <jj4public@vfemail.net> - 2019-03-24 13:37 +0700
              Re: ShellExecute with "RunAs" verb ignores the working directory argument "Mayayana" <mayayana@invalid.nospam> - 2019-03-24 11:17 -0400
                Re: ShellExecute with "RunAs" verb ignores the working directory argument JJ <jj4public@vfemail.net> - 2019-03-25 20:12 +0700
                Re: ShellExecute with "RunAs" verb ignores the working directory argument "Mayayana" <mayayana@invalid.nospam> - 2019-03-25 10:52 -0400
  Re: ShellExecute with "RunAs" verb ignores the working directory argument Thomas Langer <spam4nl@langer-online.net> - 2019-03-24 22:50 +0100

csiph-web