Salut tout le monde,
Je vous explique mon probleme qui me hante depuis deja 3 jours.
Je dois lancer un script VBS qui se trouve dans un certains repertoire accompagne de certains fichier config propre a l'installation d'un certain programme.
J'ai besoin de lancer ce script VBS a partir d'un autre script VB que l'administrateur a fait, le probleme est que je recupere l'erreur suivante :
Line 14
Char 1
Error File not found
Code 800A0035
source Microsoft VBScript runtime error
Et quand je lance le VBS direcement sans passer par le VB tout se passe bien.
J'aimreais donc avoir votre opinion sur le sujet, j'ai pense a integrer directement mon VBS a mon VB mais je ne c'est pas comment faire.
Merci de votre aide.
Ici mon fichier VBS, je suis desole j'arrive pas a faire de quote et j'ai pas eu le temps de mettre les balise.
Set WshShell = WScript.CreateObject("WScript.Shell" )
Dim path : path = WshShell.ExpandEnvironmentStrings("%SystemRoot%\temp\3rdParty" )
Dim installdir : installdir = WshShell.ExpandEnvironmentStrings("%SystemDrive%\Program Files\eEye Digital Security\Blink" )
Dim backuppath : backuppath = installdir
Dim tmppath : tmppath = ""
Dim newpath : newpath = ""
Dim TristateFalse : TristateFalse= 0
Dim filesys, file, ts
Const ForAppending = 8
Const ForReading = 1
Set filesys = CreateObject("Scripting.FileSystemObject" )
Set file = filesys.GetFile("settings.txt" )
Set ts = file.OpenAsTextStream( ForReading )
'parse the MSI options file and see if the expanded paths are present
Do While Not ts.AtEndOfStream
if InStr(ts.ReadLine, "INSTALLDIR=" ) > 0 Then
AlreadyModified = 1
End if
Loop
if AlreadyModified = 0 Then
'Append the expanded paths to the MSI configuration file (settings.txt)
Set ts = file.OpenAsTextStream( ForAppending )
ts.WriteLine("INSTALLDIR=" & installdir)
ts.WriteLine("THIRDPARTY=" & path & "\eeyeremoteinstall.exe" )
ts.Close
End If
Dim nIndex
nIndex = InStr(backuppath, "\" )
while nIndex > 0
tmppath = Left(backuppath, nIndex)
backuppath = Right(backuppath, Len(backuppath) - nIndex)
newpath = newpath + tmppath
If Not filesys.FolderExists(newpath) Then
Set newfolder = filesys.CreateFolder(newpath)
End If
nIndex = InStr(backuppath, "\" )
Wend
If Len(backuppath) > 0 Then
newpath = newpath + backuppath
If Not filesys.FolderExists(newpath) Then
Set newfolder = filesys.CreateFolder(newpath)
End If
End If
path = WshShell.ExpandEnvironmentStrings("%SystemRoot%" ) & "\temp"
'create c:\windows\temp\3rdparty
if filesys.FolderExists(path) = 0 Then
filesys.CreateFolder(path)
End If
if filesys.FolderExists(path & "\3rdparty" ) = 0 Then
path = path & "\3rdparty"
filesys.CreateFolder(path)
End If
path = WshShell.ExpandEnvironmentStrings("%SystemRoot%\temp\3rdParty" )
'get the current folder
set file = filesys.GetFile("settings.txt" )
filesys.CopyFolder file.ParentFolder , path
Set WshShell = WScript.CreateObject("WScript.Shell" )
WshShell.Run "cmd /K CD " & path & " & Setup /qn /qb+ /Liom " & chr(34) & installdir & "\BlinkSetup.log" & chr(34) & " OPTIONFILE=" & chr(34) & path & "\settings.txt" & chr(34)