Error Message running VB script in Windows 2008 Server
20 pts.
0
Q:
Error Message running VB script in Windows 2008 Server
I run a simple vb script to copy files from one direectory to another. I get an error back saying that the path can't be found. I run it like this:

C\:> cscript mycopy.vbs

I get back an error that says the path is invalid and shows something like this:
C:\mycopy.vbs(4,1) could not be found

Where is the (4,1) coming from and is this what is preventing the file from being found by Microsoft?
ASKED: Aug 11 2009  11:17 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
29855 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
I think the script file (mycopy.vbs) is in fact being found, but it is generating an error when executed, and the error is being generated by line 4 of your script code (that is what the (4,1) part means).

-----------------------
Last Answered: Aug 11 2009  11:42 PM GMT by Carlosdl   29855 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Grabber   20 pts.  |   Aug 12 2009  3:00PM GMT

That would be correct if it also gave me an error in Windows 2003 but it doesn’t .
Here is the script

Set objFS = CreateObject(”Scripting.FileSystemObject”)
strFolder = “c:Transcriptsdocfiles”
strDestination = “c:docs”
Set objFolder = objFS.GetFolder(strFolder)

Go(objFolder)

Sub Go(objDIR)
If objDIR <> “System Volume Information” Then
For Each eFolder in objDIR.SubFolders
Go eFolder
Next
For Each strFile In objDIR.Files
strFileName = <a href="http://strFile.Name" title="http://strFile. " target="_blank">strFile.Name</a>
strExtension = objFS.GetExtensionName(strFile)
If strExtension = “doc” Then
objFS.CopyFile strFile , strDestination & strFileName
End If
Next
End If
End Sub

 

Carlosdl   29855 pts.  |   Aug 12 2009  4:14PM GMT

Grabber, it has nothing to do with the operating systems.

It gives you an error in 2008 because it is another machine, and it does not necessarily have the same directory structure and access permissions.

Are you sure the “c:\Transcriptsdocfiles” directory exists in the 2008 server and that you have access permissions on it ?

You might want to make some tests changing the code of your script, to see what you get back when the script has errors (and to confirm that the script is actually being executed).

 
0