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 6778887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:19:12+00:00 2026-05-26T16:19:12+00:00

I need in a script to return the path to the current user desktop.

  • 0

I need in a script to return the path to the current user desktop. Now I know you can do it with WScript.

var WshShell = WScript.CreateObject("WScript.Shell");
         strDesktop = WshShell.SpecialFolders("Desktop");

But for my script this will not work as I cant use WScript. but I can use the shell.application object as below.

 dim objShell
        dim ssfWINDOWS
        dim objFolder

        ssfWINDOWS = 0
        set objShell = CreateObject("shell.application")
            set objFolder = objshell.BrowseForFolder(0, "Example", 0, ssfWINDOWS)
                if (not objFolder is nothing) then
                Set objFolderItem = objFolder.Self
                    g_objIE.Document.All("logdir").Value = objFolderItem.path
                end if
            set objFolder = nothing
        set objShell = nothing

what is the syntax so the rather than “BrowseForFolder” i can simple return the path of the current users desktop?

IE replace the line

set objFolder = objshell.BrowseForFolder(0, "Example", 0, ssfWINDOWS)

with the equilivent of.

strDesktop = WshShell.SpecialFolders("Desktop");

Cheers

Aaron

  • 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-26T16:19:12+00:00Added an answer on May 26, 2026 at 4:19 pm

    You need to use Shell.Namespace(...).Self.Path:

    Const ssfDESKTOPDIRECTORY = &h10
    Set oShell = CreateObject("Shell.Application")
    strDesktop = oShell.NameSpace(ssfDESKTOPDIRECTORY).Self.Path
    
    WScript.Echo strDesktop
    

    But for my script this will not work as I cant use WScript.

    Do you mean you can’t use WScript.CreateObject(...) because WScript is undefined? If so, you can simply use CreateObject("WScript.Shell").SpecialFolders("Desktop") instead. See What is the difference between CreateObject and Wscript.CreateObject?.

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

Sidebar

Related Questions

In a shell-script (or Perl) I need a subroutine that returns for all my
I need a java script function that converts the document object of the current
im working on jquery script to show rollover , now i need to show
I need a PowerShell script that can access a file's properties and discover the
Here is my script: <script> Raphael.fn.polyline = function(pointString) { return this.path(M + pointString); };
I need to generate multiple databases to SQL, so I need script/program to automatically
I need to script the creation of app pools and websites on IIS 6.0.
A python script need to spawn multiple sub-processes via fork(). All of those child
I need a script to run on Vista Ultimate to share an external drive
I need a script to convert a comma seperated csv file to an excel

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.