GET-IT: TEAMS DAY | 1-Day Free Virtual Conference all about Teams. Here on Petri.com - 8/12/20 GET-IT: TEAMS DAY - 8/12/20

Help with a VBS

Home Forums Scripting Windows Script Host Help with a VBS

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    dfortier
    Member
    #161430

    I have trouble with my script. I want to output the result from the command accesschk to a text file. When i run it from the command prompt it is ok. It create and populated my text file. But when i run the vbs script i see noting.

    On Error Resume Next

    Dim partage,groupe,resultat,strCommand

    Set WshShell = WScript.CreateObject(“WScript.Shell”)

    partage = inputbox(“Entrer le chemin du partage à valider:”)
    groupe = inputbox(“Entrer le nom du groupe à valider:”)
    ‘resultat = c:scriptsresult.txt

    PATH_TOOLS = “\servernamesoftwaredistribution$Toolsaccesschk.exe”
    strCommand = “WshShell.run %comspec% /K ” & ” ” & PATH_TOOLS & ” ” &groupe & ” ” & ” -s ” & ” ” &partage & ” ” &” >> c:scriptsresult.txt 2>&1″

    If partage <> “” Then
    WshShell.run strCommand,1,FALSE
    End if[/CODE][CODE]On Error Resume Next

    Dim partage,groupe,resultat,strCommand

    Set WshShell = WScript.CreateObject(“WScript.Shell”)

    partage = inputbox(“Entrer le chemin du partage à valider:”)
    groupe = inputbox(“Entrer le nom du groupe à valider:”)
    ‘resultat = c:scriptsresult.txt

    PATH_TOOLS = “\servernamesoftwaredistribution$Toolsaccesschk.exe”
    strCommand = “WshShell.run %comspec% /K ” & ” ” & PATH_TOOLS & ” ” &groupe & ” ” & ” -s ” & ” ” &partage & ” ” &” >> c:scriptsresult.txt 2>&1″

    If partage <> “” Then
    WshShell.run strCommand,1,FALSE
    End if[/CODE]

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.