WScript.Arguments aren't working 100% of the time : HTML + VBScript
This is my first post. I have looked through a number of posts but haven't found anything like my issue. I'm still fairly new to the vbscript world so any help is GREATLY appreciated.
I am trying to pass a value in from an HTML file (code below). For some reason still unknown to me the Args(0) works when I am using the FSO.CreateTextFile(Args(0) & "mytext.txt", True) command but doesn't work for FSO.CopyFile Args(0), "C:\temp\myfolder\". My goal is to pass in a whole file path "C:\something\mytextfile.txt" from the HTML file and then copy the file off to another folder using vbscript.
I have tried to see the value of Args(0) using msgboxs and printing it out to a cmd window but it appears as nothing. I am at my wits end and ready to jump off the bridge. Please can someone explain to me what I'm doing wrong? What do I need to do to pass in an argument that has the filepath?
Thank you, Thank you, Thank you,
I have a vbs file:
Dim FSO, Args, tsOut
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Args = WScript.Arguments
Set tsOut = FSO.CreateTextFile(Args(0) & "mytext.txt", True)
Re: WScript.Arguments aren't working 100% of the time : HTML + VBScript
What happens when you fire SETPATH()? My thought is that your PATH variable is not getting set correctly.
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz' save a blobFileStreamDataTable To Text Filemy blog