Un problème pour configurer le FireWall en vérifiant l'existance d'un fichier
2 réponses
FRED
Bonjour,
Dans un script pour configurer le FireWall, tout marchait bien jusqu'à que
je teste l'existence d'un fichier afin d'autoriser la bonne version d'une
application:
'demande d'ajout de Mon_application
DIM oWshShell2
Set oWshShell2 = Wscript.CreateObject ("Wscript.Shell")
DIM msg2
msg2 = oWshShell2.Popup("Souhaitez-vous ajouter Mon_application",90,"AJOUT
D'APPLICATION AU FIREWALL",4)
if msg2 = 6 then
'recherche de la version de Mon_application
CONST FICHIER = "c:\Program Files\Mon_applicationv1.exe"
Set Sysfichier = CreateObject ("scripting.FileSystemObject")
If Sysfichier.FileExists(Fichier) Then
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Stéphane [MS]
Bonjour,
D'après ScriptCenter, je rajouterais :
Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
aux lignes : Set objApplication = CreateObject("HNetCfg.FwAuthorizedApplication")
Puis, à la fin : Set colApplications = objPolicy.AuthorizedApplications colApplications.Add(objApplication)
-- Cdlt Stéphane
Bonjour,
Dans un script pour configurer le FireWall, tout marchait bien jusqu'à que je teste l'existence d'un fichier afin d'autoriser la bonne version d'une application:
'demande d'ajout de Mon_application DIM oWshShell2 Set oWshShell2 = Wscript.CreateObject ("Wscript.Shell") DIM msg2 msg2 = oWshShell2.Popup("Souhaitez-vous ajouter Mon_application",90,"AJOUT D'APPLICATION AU FIREWALL",4) if msg2 = 6 then
'recherche de la version de Mon_application CONST FICHIER = "c:Program FilesMon_applicationv1.exe" Set Sysfichier = CreateObject ("scripting.FileSystemObject") If Sysfichier.FileExists(Fichier) Then
Le script s'exécute sans problème ni erreur, mais lorsque je me rends dans le FireWall Mon_application v1 ou v2 ne figure pas !!
Si quelqu'un a une idée,
Merci.
FRED.
Bonjour,
D'après ScriptCenter, je rajouterais :
Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
aux lignes :
Set objApplication = CreateObject("HNetCfg.FwAuthorizedApplication")
Puis, à la fin :
Set colApplications = objPolicy.AuthorizedApplications
colApplications.Add(objApplication)
--
Cdlt
Stéphane
Bonjour,
Dans un script pour configurer le FireWall, tout marchait bien jusqu'à que
je teste l'existence d'un fichier afin d'autoriser la bonne version d'une
application:
'demande d'ajout de Mon_application
DIM oWshShell2
Set oWshShell2 = Wscript.CreateObject ("Wscript.Shell")
DIM msg2
msg2 = oWshShell2.Popup("Souhaitez-vous ajouter Mon_application",90,"AJOUT
D'APPLICATION AU FIREWALL",4)
if msg2 = 6 then
'recherche de la version de Mon_application
CONST FICHIER = "c:Program FilesMon_applicationv1.exe"
Set Sysfichier = CreateObject ("scripting.FileSystemObject")
If Sysfichier.FileExists(Fichier) Then
Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
aux lignes : Set objApplication = CreateObject("HNetCfg.FwAuthorizedApplication")
Puis, à la fin : Set colApplications = objPolicy.AuthorizedApplications colApplications.Add(objApplication)
-- Cdlt Stéphane
Bonjour,
Dans un script pour configurer le FireWall, tout marchait bien jusqu'à que je teste l'existence d'un fichier afin d'autoriser la bonne version d'une application:
'demande d'ajout de Mon_application DIM oWshShell2 Set oWshShell2 = Wscript.CreateObject ("Wscript.Shell") DIM msg2 msg2 = oWshShell2.Popup("Souhaitez-vous ajouter Mon_application",90,"AJOUT D'APPLICATION AU FIREWALL",4) if msg2 = 6 then
'recherche de la version de Mon_application CONST FICHIER = "c:Program FilesMon_applicationv1.exe" Set Sysfichier = CreateObject ("scripting.FileSystemObject") If Sysfichier.FileExists(Fichier) Then
Le script s'exécute sans problème ni erreur, mais lorsque je me rends dans le FireWall Mon_application v1 ou v2 ne figure pas !!
Si quelqu'un a une idée,
Merci.
FRED.
FRED
Bonjour,
Merci de votre réponse. Je me replonje dans mon script.
FRED.
"Stéphane [MS]" a écrit dans le message de news:
Bonjour,
D'après ScriptCenter, je rajouterais :
Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
aux lignes : Set objApplication = CreateObject("HNetCfg.FwAuthorizedApplication")
Puis, à la fin : Set colApplications = objPolicy.AuthorizedApplications colApplications.Add(objApplication)
-- Cdlt Stéphane
Bonjour,
Dans un script pour configurer le FireWall, tout marchait bien jusqu'à que je teste l'existence d'un fichier afin d'autoriser la bonne version d'une application:
'demande d'ajout de Mon_application DIM oWshShell2 Set oWshShell2 = Wscript.CreateObject ("Wscript.Shell") DIM msg2 msg2 = oWshShell2.Popup("Souhaitez-vous ajouter Mon_application",90,"AJOUT D'APPLICATION AU FIREWALL",4) if msg2 = 6 then
'recherche de la version de Mon_application CONST FICHIER = "c:Program FilesMon_applicationv1.exe" Set Sysfichier = CreateObject ("scripting.FileSystemObject") If Sysfichier.FileExists(Fichier) Then
Le script s'exécute sans problème ni erreur, mais lorsque je me rends dans le FireWall Mon_application v1 ou v2 ne figure pas !!
Si quelqu'un a une idée,
Merci.
FRED.
Bonjour,
Merci de votre réponse.
Je me replonje dans mon script.
FRED.
"Stéphane [MS]" <spapp@online.microsoft.com> a écrit dans le message de
news: 8F782242-F907-456D-B314-66B906DD4555@microsoft.com...
Bonjour,
D'après ScriptCenter, je rajouterais :
Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
aux lignes :
Set objApplication = CreateObject("HNetCfg.FwAuthorizedApplication")
Puis, à la fin :
Set colApplications = objPolicy.AuthorizedApplications
colApplications.Add(objApplication)
--
Cdlt
Stéphane
Bonjour,
Dans un script pour configurer le FireWall, tout marchait bien jusqu'à
que
je teste l'existence d'un fichier afin d'autoriser la bonne version d'une
application:
'demande d'ajout de Mon_application
DIM oWshShell2
Set oWshShell2 = Wscript.CreateObject ("Wscript.Shell")
DIM msg2
msg2 = oWshShell2.Popup("Souhaitez-vous ajouter
Mon_application",90,"AJOUT
D'APPLICATION AU FIREWALL",4)
if msg2 = 6 then
'recherche de la version de Mon_application
CONST FICHIER = "c:Program FilesMon_applicationv1.exe"
Set Sysfichier = CreateObject ("scripting.FileSystemObject")
If Sysfichier.FileExists(Fichier) Then
Merci de votre réponse. Je me replonje dans mon script.
FRED.
"Stéphane [MS]" a écrit dans le message de news:
Bonjour,
D'après ScriptCenter, je rajouterais :
Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
aux lignes : Set objApplication = CreateObject("HNetCfg.FwAuthorizedApplication")
Puis, à la fin : Set colApplications = objPolicy.AuthorizedApplications colApplications.Add(objApplication)
-- Cdlt Stéphane
Bonjour,
Dans un script pour configurer le FireWall, tout marchait bien jusqu'à que je teste l'existence d'un fichier afin d'autoriser la bonne version d'une application:
'demande d'ajout de Mon_application DIM oWshShell2 Set oWshShell2 = Wscript.CreateObject ("Wscript.Shell") DIM msg2 msg2 = oWshShell2.Popup("Souhaitez-vous ajouter Mon_application",90,"AJOUT D'APPLICATION AU FIREWALL",4) if msg2 = 6 then
'recherche de la version de Mon_application CONST FICHIER = "c:Program FilesMon_applicationv1.exe" Set Sysfichier = CreateObject ("scripting.FileSystemObject") If Sysfichier.FileExists(Fichier) Then