Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 209565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:55:37+00:00 2026-05-11T17:55:37+00:00

I have a little problem with a simple vbScript. The script has to run

  • 0

I have a little problem with a simple vbScript. The script has to run 2 action one after the other.

Option Explicit

Dim WshShell
Dim Yesterday
Dim resultat
Dim commande
Dim Jour

Set WshShell = WScript.CreateObject("WScript.Shell")

Yesterday =  DateAdd("d", -2, Date())
resultat = "00001"
resultat = resultat & Right(Year(Yesterday), 2)
Jour = (Datepart("y", Yesterday))

If ((Jour < 100) and (Jour > 9)) Then resultat = resultat & "0" & Jour

If (Jour < 10) Then resultat = resultat & "00" & Jour

If (Jour >= 100) Then resultat = resultat & Jour

resultat = """(&(objectClass=eTGlobalUser)(eTSuspended=0)(eTRoleDN=*)(eTUpdateDate>=" & resultat & "))"""

commande = GetScriptPath() & "PharosGDH.exe /ldapfilter:" & resultat & " /conso"
WshShell.Run commande, 5, true
commande2 = GetScriptPath() & "PharosGDH.exe /all /auditPharos
WshShell.Run commande2, 5, true
WScript.Quit 1

Function GetScriptPath()
    GetScriptPath = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\"))
End Function

Can someone tell me what is wrong please?

Sorry the declaration was missing on the copy/past, And the windows juste shutdown silently, after that i see that result is not has it suposed to be!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:55:37+00:00Added an answer on May 11, 2026 at 5:55 pm

    Is this your actual code? There are at least two syntax errors in it:

    First syntax error:

    commande2 = GetScriptPath() & "PharosGDH.exe /all /auditPharos
    

    There are double quotes missing at the end of the line:

    commande2 = GetScriptPath() & "PharosGDH.exe /all /auditPharos"
    

    Second syntax error:

    Dim resultat
    Dim commande
    Dim Jour
    

    The variable “commande2” is used, but not declared. Use:

    Dim resultat
    Dim commande
    Dim commande2
    Dim Jour
    

    If this does not fix your problem, as the others have said, please tell us, what the problem is: Error message? Wrong behaviour?

    Second attempt

    Maybe display the commands used before executing them to be able to check that they contain the right content:

    commande = GetScriptPath() & "PharosGDH.exe /ldapfilter:" & resultat & " /conso"
    WshShell.Popup commande
    WshShell.Run commande1, 5, true
    commande2 = GetScriptPath() & "PharosGDH.exe /all /auditPharos"
    WshShell.Popup commande
    WshShell.Run commande2, 5, true
    WScript.Quit 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 137k
  • Answers 137k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer That sounds weird. IDEA on the fly inspections which you… May 12, 2026 at 7:21 am
  • Editorial Team
    Editorial Team added an answer If this is a short-term thing, you could use an… May 12, 2026 at 7:21 am
  • Editorial Team
    Editorial Team added an answer I've since discovered that it had to do with 3… May 12, 2026 at 7:21 am

Related Questions

I have a little math problem. I would like to have a function with
I have created a simple test form with FormBorderStyle = FixedToolWindow by default and
I have a simple, real life problem I want to solve using an OO
Ok, this may sound a little weird, but what I need to do is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.