Tuesday 16 September 2014

This script creates a message box to tell the user that on the next reboot the machine will installed a determined software.then it writes a reg key to run the package or other scripts. You can send this script before running the actual package installation:

******************************************************



' NAME: MsgBox
'
' AUTHOR:  
'
' DATE  : 12/02/2014
'
' COMMENT: create a msgbox for user while writes a reg key in runonce.
'
'exemplary damages arising out of or in any way relating to the use of this script, 
'including without limitation damages for loss of goodwill, work stoppage, 
'lost profits, loss of data, and computer failure or malfunction. 
'You bear the entire risk as to the quality and performance of this script.
'
'$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Option Explicit 
Dim Fichero
Dim lcScriptPath
Dim lcScriptName
Dim App_Path
Dim oShell,ofso,strRuta
Dim Shell
Dim objFso
Dim strPath
Set ofso = CreateObject("Scripting.FileSystemObject") 
Set oShell = WScript.CreateObject("WScript.Shell")


 MsgBox "A package has been delivered to your computer, please reboot for changes to be applied.", vbOKOnly, "@soft name"
  

Set shell= createobject("WSCRIPT.SHELL")
Set objFso = CreateObject("Scripting.FileSystemObject")
strPath = objFso.GetParentFolderName(WScript.ScriptFullName)


strRuta= "cscript.exe " & strPath & "\2_CopyFileSAPlogon.vbs"


oShell.regwrite "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\Copy@@Program.exe@@",strRuta,"REG_SZ"
  
  
  
  strRuta = ""
Set ofso=Nothing
Set oShell= Nothing
WScript.Quit

****************************************************

0 commenti:

Post a Comment

Give me you feedback!