raphael75
raphael75

Reputation: 3238

vbs runs by double clicking, freezes when run from task scheduler

I have a .vbs script that copies files from multiple remote computers. Each server has a shared folder that I map as a network drive (W:). When I run it by double-clicking, it runs fine, but if I run it from Task Scheduler (Win Server 2003) it hangs on this line:

NetworkObject.MapNetworkDrive "W:", "\xxx.xxx.xxx.xxx\sharename", false, [username], [password]

I've tried everything but I can't figure out why it won't run in task scheduler. Please help!

Upvotes: 2

Views: 1811

Answers (1)

user1955689
user1955689

Reputation: 21

Did you try to run it like:

C:\Windows\system32\cscript.exe yourscript.vbs

Upvotes: 2

Related Questions