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

  • SEARCH
  • Home
  • 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 6246769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:45:05+00:00 2026-05-24T12:45:05+00:00

I am writing a script to capture the login time. In the final production,

  • 0

I am writing a script to capture the login time. In the final production, there would be no input from any user. However I am testing it and I wanted to know how I add extra code to determine that

  1. If its in ‘debug’ mode AND
  2. The user that is logging in is me (lets say my username is joe.smith on the domain called EXAMPLE)

then present an input box to allow me to type the date, time for logging in.

All other users would never see this and it would capture today with the system time.

I would also like to hide the code so if the script is opened by the wrong person, they wouldnt be able to make heads or tails of whats going on.

  • 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-24T12:45:07+00:00Added an answer on May 24, 2026 at 12:45 pm

    You can use a command line parameter as Matt says to set the script into debug mode, eg

    dim isdebug: isdebug = WScript.Arguments.Named.Exists("debug")
    WScript.Echo("in debug mode: " & isdebug)
    

    Which you can invoke with

    wscript debugscript.vbs /debug
    

    To get the current user name, you can use either the WMI Service or the WScript.Network object.

    Once you have the username, you can conditionally throw up an InputBox and collect the value returned:

    dim date_: date_ = Now()
    if isdebug and username = "me"  then
        dim value: value = CDate(InputBox("enter the date and time (dd/mm/yyyy hh:mm:ss)", "please", Now()))
        ' validate the input here
        date_ = CDate(value) 
    end if
    

    And finally, to obfuscate your code you could use the Scripting.Encoder although it looks like this doesn’t seem to be supported on Vista or Windows 7. There does seem to be a few hits on googling the phrase obfuscating vbscript, anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a script at the moment that will grab certain information from
I am writing a script that will transfer a file from one server to
I'm writing a small script to capture link clicks and save the link's URL
I'm writing a script that logs errors from another program and restarts the program
I'm writing a script in Python that saves attachments from Gmail, only from unseen
I'm writing an automation script on a production server that, among other things, needs
I am writing a script to capture disk usage on a system (yes, I
I'm writing a script that should rewrite all links on a page from http://
I would like to capture output from a UNIX process but limit max file
I'm writing script that build apps with cron task, I can build any app

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.