sexta-feira, 29 de novembro de 2013

VBScript melhora acesso ao EMS204 e da prioridade no Sistema ( VBScript )


Dim MaqName, BtnCode, bKey
Const OverwriteExisting = True

Set Wshell   = CreateObject("Wscript.Shell")
Set Net      = CreateObject("Wscript.Network")
Set FSODrive = CreateObject("Scripting.FileSystemObject")
CompName     = Wshell.ExpandEnvironmentStrings("%COMPUTERNAME%")
Usuario      = Wshell.ExpandEnvironmentStrings("%USERNAME%")

FSODrive.CopyFile "\\unialco.local\netlogon\ti\splashscreen.bmp", "C:\dlc101c\bin\splashscreen.bmp", OverwriteExisting

Wshell.Run "%Windir%\system32\Rundll32.exe advapi32.dll, ProcessIdleTasks " 

If FSODrive.DriveExists("S:") Then
   If not FSODrive.FileExists("C:\dlc101c\bin\EMS204_10c_"&CompName&"_"&Usuario&"_16.exe") Then
      FSODrive.CopyFile "C:\dlc101c\bin\prowin32.exe", "C:\dlc101c\bin\EMS204_10c_"&CompName&"_"&Usuario&"_16.exe", OverwriteExisting
   End if
   Wshell.Run "C:\dlc101c\bin\EMS204_10c_"&CompName&"_"&Usuario&"_16.exe -basekey "+"ini"+" -ininame S:\ems\204_10\scripts\ini\ems2-luciano.ini -pf  S:\ems\204_10\scripts\pf\ems2-luciano.pf -p alias/menu.p -param DIS"
Else
   If FSODrive.DriveExists("R:") Then
      If not FSODrive.FileExists("C:\dlc101c\bin\EMS204_10c_"&CompName&"_"&Usuario&"_15.exe") Then
          FSODrive.CopyFile "C:\dlc101c\bin\prowin32.exe", "C:\dlc101c\bin\EMS204_10c_"&CompName&"_"&Usuario&"_15.exe", OverwriteExisting
      End if
      Wshell.Run "C:\dlc101c\bin\EMS204_10c_"&CompName&"_"&Usuario&"_15.exe -basekey "+"ini"+" -ininame R:\ems\204_10\scripts\ini\ems2-luciano.ini -pf  R:\ems\204_10\scripts\pf\ems2-luciano.pf -p alias/menu.p -param DIS"
   Else
      Mensagem()
   End If
End If

Function Mensagem
strTitulo = "Seção Técnica de Informática"
strMensagem = _
"AVISO IMPORTANTE" & vbcrlf & vbcrlf & _
"Favor entrar em contato com o Departamento de TI" & vbcrlf & _
"Não existe servidores disponiveis para mapeamento" & vbcrlf & _
"Ligar para 8960 - Antonio Luis Deonisio"
'BtnCode = WshShell.Popup(strMensagem, 5, "Informação:", 64 + 0)
msgbox strMensagem, 0 + 64, strTitulo
End Function

Nenhum comentário:

Postar um comentário