Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

Probably a really simple one: objShell.run

$
0
0
Hi all

Making the transition from batch to VB so apologies for what is certainly quite an easy one.

I am trying to automate several tasks via a *vbs and the majority is working... however one thing is failing.

I am using the below just to run a simple CMD line command

Code:

Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "ren c:\backup\*.xml ABC1.xml"
Set oShell = Nothing

If I run ren c:\backup\*.xml ABC1.xml direct from the CMD it works fine but if I run it from the *.vbe I get a "Line 3 Character 1 System cannot find file specified"

What am I doing wrong?

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>