• 0

VBScript Error in Win7 x64 only


Question

I'm trying to implement this script so users can right click a file and Send to NetDocuments (our cloud-based document management service). It works on our Terminal Server and on Windows XP clients. On my Win7x64 machine, I get the error:

Script: C:\Users\Matt\Downloads\NetDocuments.vbs
Line: 7
Char: 1
Error: Could not create object named "ND.ActiveDoc".
Code: 80040154
Source: WScript.CreateObject

Here is the full script:

Option Explicit

Const AsyncTimeout = 3, AsyncSuccess = 0

'*** Instantiate an Active Document object
Dim ad
Set ad = WScript.CreateObject( "ND.ActiveDoc" )

Dim intanswer
Dim docList, i, asyncStatus
Dim fso, fso2, aFile, objArgs, StrArg
Dim argcount

Set fso = CreateObject("Scripting.FileSystemObject")
Set fso2 = CreateObject("Scripting.FileSystemObject")

docList = "<DOCUMENTLIST>"

set objArgs = WScript.Arguments

argcount = WScript.Arguments.Count

if argcount > 40 then
 Msgbox("Too many documents at once, the limit is 40")
else

 ' *** Loop through each argument and create document list
 for each strArg in objArgs
  ' WScript.Echo strArg
  strarg = replace(strarg,"&", "&")
  doclist = doclist & "<DOCUMENT><LOCATION>" & strArg & "</LOCATION></DOCUMENT>"
 next

 docList = docList & "</DOCUMENTLIST>"

 ' *** Make Backup Copies of the files w/.BAK extension
 for each strArg in objArgs
  fso.CopyFile StrArg, StrArg & ".bak"
 next

 ' *** Import the Documents
 ad.Import docList, "new document"

 ' *** Wait for the import to complete
 i = 0
 do
  asyncStatus = ad.WaitForCompletion( 300 )
   i = i + 1
 loop while i < 18 and asyncStatus = AsyncTimeout

 ' *** Check to see if import was successful
 if asyncStatus = AsyncSuccess then
   ' *** prompt the user to delete the original documents
   intanswer = MsgBox("Import Succeeded - Delete Originals?", vbyesno,"NetDocuments Import")
   if intanswer = vbyes then
     ' *** if yes, delete
     for each strArg in objArgs
       Set fso2 = CreateObject("Scripting.FileSystemObject")
       Set aFile = fso2.GetFile(strArg & ".bak")
       aFile.Delete
     next
  else
     ' *** if no, rename .bak files back to original
     for each strArg in objArgs
      Set aFile = fso.GetFile(strArg & ".bak")
      aFile.Move strArg
    next

  end if
 else
   ' *** if not, put the original files back
   WScript.Echo "Import Failed"
    for each strArg in objArgs
     Set aFile = fso.GetFile(strArg & ".bak")
     aFile.Move strArg
   next
 end if
end if

Link to comment
https://www.neowin.net/forum/topic/913100-vbscript-error-in-win7-x64-only/
Share on other sites

1 answer to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I think you answered why it gets so much attention in your comment. It's designed to make Windows accessible to everyone! It's a core component of the Windows UI, and 30 years of its existence is why it remains such a key component and receives so much attention to this day!
    • I agree with your points, particularly around workflows. But I think this is a symptom of the way Microsoft plans, builds, and releases its OS's, not about its UI ideals itself. It has historically been large jumps in UI changes between releases, XP > Vista > 7 > 8 were ALL significant changes in how we performed tasks. Then Win10 was released and updated twice a year with minor changes. This was somewhat nice as the changes were often minimal, however as it looked like the same OS for the most part, when something did change (like the start menu), it was a bit confusing for people who didn't understand that they had actually been upgraded, and why just this one key part of their workflow had changed. But I believe that was too slow, and didn't allow their future designs to be played out in that release structure. So the "last Windows version ever" was superseded with a new UI and overhauled once more. It too has changed quite a bit in its 4 years, but I think there needs to be an understanding of that change, which I guess we have in the "24H2" version numbering, but not in the marketing that most users know. The most consistent and clear communication of changes I think is done with MacOS. While I'm not a fan of Apples software, their clear and consistent release schedule, and progressively planned changes to the OS is easy to understand, leading towards a well thought out goal. Their users understand the branding of the big updates, and that changes will occur when they update, yet these are more subtle than changes we see in Windows 7 > 8 > 10 > 11 releases. On that, Windows 10/11 version updates just get lost in the vast collection of update types in Windows Update, and as such most users wouldn't know if the were on 22H2, 23H2 or 24H2, or even know what those meant. My thoughts are that Microsoft will drop the Win11/Win12 branding once Windows 10 has finally died. And hopefully, make it a bit more consistent with feature/UI updates sticking to an improved branded version/year release rather than "moments" or just randomly enabled elements in a random monthly update. Until then, even us tech users rarely know what features are in what release and if we will see it on our own computers. Get with it MS!
    • Hello, Horizon Data Systems, the developer, has been around for 27 years.  I do not recall hearing anything bad about them, but I also haven't used their software, either. Regards, Aryeh Goretsky  
    • Hello, I am wondering if this will go through an appeal process, or if the ruling is final? Regards, Aryeh Goretsky
    • Hello, I think it also depends upon what sorts of software you develop. My employer makes software that does rely on operating system version-specific functionality, and that is typical and normal behavior for our industry. While we do provide support for older versions of operating systems, it is only for a certain amount of time. If you still want to use our software after that, it becomes a custom support package, which isn't cheap. Regards, Aryeh Goretsky
  • Popular Contributors

    1. 1
      +primortal
      603
    2. 2
      ATLien_0
      214
    3. 3
      +FloatingFatMan
      169
    4. 4
      Michael Scrip
      151
    5. 5
      Som
      151
  • Tell a friend

    Love Neowin? Tell a friend!