Jump to content

Start .vbs from within cmd wont work (again)


Recommended Posts

Hi all,

I'm hoping someone can help me out, this problem has brought me to tears. In the past it worked, it was finished, done and dusted. But then I lost a pen drive and had to start over. It was an unattended install, RunOnce section calls .exe (self extract archive) this puts files in sys32, subsequently sfx runs Register.cmd, also in sys32. The list of commands contained are all proven to work, except for this pesky .vbs script, (it should close a window that Register.cmd previously opened).

The height of irony is that I was helped on this problem in past on this forum. I have re-read that thread and followed the advice and it still doesn't work. The folder will no %$^&@"£ close!! Its one of those things you won't accept no for an answer after wasting this much time.

If SFX is run after logon it desired effect manifests > window opens closes. If .cmd is extracted manually to sys32 and run same story.

Here is the .cmd file:

Quote

@echo off
SETLOCAL ENABLEEXTENSIONS
ZipFile.zip
Regedit /s Hubble.reg
Regedit /s Color.reg
Regedit /s Mplayerc.reg
"%windir%\system32\cmd.exe" /c "Start /wait %windir%\system32\ZipClose.vbs //nologo"
Del "%systemroot%\system32\*.reg"
exit

START "" ZipClose.vbs //nologo also works from within SFX but only if done manually after logon.

After logon; If "ZipClose.vbs //nologo" is placed in an empty .cmd, and executed by double click from within sys32, this also works. However it won't work if added to SFX, let alone RunOnce.

The zipclose.vbs looks like this:

Quote

Set oShell = CreateObject("WScript.Shell")
If oShell.AppActivate("ZipFile.zip") Then
   WScript.Sleep 500
   oShell.SendKeys "%{F4}"
End If

"ZipFile.zip" is not "ZipFile", a change to reflect the "always show extensions for know file types" option, enabled from nlite.

FWIW, the SFX contains no sub-directory. It extracts into sys32 (%WINDIR%/system32).

 

I realize this is inconsequential and user can click close window manually... its just that it worked before and makes no sense why.

Edited by shorterxp
Link to comment
Share on other sites

  • 3 weeks later...

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...