
registry %1 argument and short/long path names
Thanks Michael. Attached is script explaining why I need this information,
based on discussion in CAPICOM discussion group.
BTW, where is the documentation on registry command options like this?
Thanks,
- Mitch Gallant
'************************************************************
' File: AutoSignWiz.vbs (WSH in VBScript)
' Author: M. I. Gallant
' Date: 04/26/2002
' Site: http://home.istar.ca/~neutron/wsh
'
' Provides drag/drop launching of Authenticode signcode.exe wizard
' with automatic file selection entered.
'
' Use also to provide context-menu semi-automation for signing:
' e.g:
' HKEY_CLASSES_ROOT\VBSFile\Shell\Digitally Sign\Command
' wscript.exe c:\scriptaids\autosignwiz.vbs "%L"
'*************************************************************
Option Explicit
Dim WshShell, sourcefile, fileargs
Const Wiz_Title = "Digital Signature Wizard" ' Window title for wizard
set WshShell = WScript.CreateObject("WScript.Shell")
Set fileargs = WScript.Arguments
If fileargs.Count<1 Then
WScript.Echo "autosignwiz.vbs is a drag/drop utility"
WScript.Quit
End If
sourcefile = fileargs(0) 'get dragged file name
' WScript.Echo sourcefile
Wshshell.Run "signcode.exe" ,1 'execute signcode and return
While NOT Wshshell.AppActivate(Wiz_Title) ' wait until ResKit doc. window is available
WScript.Sleep 200
Wend
Wshshell.AppActivate(Wiz_Title) 'make sure wizard is still selected
WScript.Sleep 200
Wshshell.SendKeys("{ENTER}") 'go to "File Selection" pane
WScript.Sleep 100
Wshshell.SendKeys(sourcefile)
WScript.Sleep 100
Wshshell.SendKeys("{ENTER}") 'go to "Signing Options" pane
'--- Allow user to continue from here, or customize with specific cert -------------------
Quote:
> > ... Is there a way to
> > force a LONG path name to be returned to myscript.vbs without having
> > to parse out myself?? (the argument gets chopped at the ~ character in 8.3
> > name).
> wscript.exe c:\somepath\myscript.vbs "%L"
> --
> Michael Harris
> Microsoft.MVP.Scripting
> Seattle WA US
> --