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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:53:36+00:00 2026-05-31T09:53:36+00:00

I have a problem in VBScript. I get an error when I run this

  • 0

I have a problem in VBScript. I get an error when I run this script. It says ‘path not found’.

<SCRIPT Language="VBScript"> 
Option Explicit    
dim filesys, filetxt 
Const ForReading = 1, ForWriting = 2, ForAppending = 8  
Set filesys = CreateObject("Scripting.FileSystemObject") 
If not filesys.FileExists("%USERPROFILE%\CAD_Kunde\CAD_Kunde.txt") Then 
    Set filetxt = filesys.OpenTextFile("%USERPROFILE%\CAD_Kunde\CAD_Kunde.txt", ForWriting, True)  
    filetxt.WriteLine ("1")
 filetxt.Close 
End If

</script>
  • 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-31T09:53:37+00:00Added an answer on May 31, 2026 at 9:53 am

    Steps to approach this problem. (I could give the solution in a oneliner, but what is the fun learning in that?)

    1. Appearently, %USERPROFILE% does not get recognized by the Scripting.FileSystem COM. So we have to replace it manually by the appropriate value.
    2. %USERPROFILE% is an environment variable. System variables can be retrieved through the ExpandEnvironmentStrings method of the Shell object. So you have to create the shell object with: Set WShell = CreateObject("Wscript.Shell")
    3. Now you can call the ExpandEnvironmentsStrings method on the Wshell object. It returns the User Profile String
    4. Use the returned string in the path.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little problem with a simple vbScript. The script has to run
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem with fancybox. I want to write a function that will run
I have a VBScript script that runs a second VBScript script. The second VBScript
I have a little problem with vbscript I have declared some function with passing
With microsoft sql server manager i know how to get this problem solved, but
I have a problem with classc ASP / VBScript trying to read an UTF-8
I have a problem with embedding a VBScript to my Javascript in a .js
We have a classic VBScript default.asp page in the root of our site. (This
i have a problem using some php functions on a string i get from

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.