Stealth3si Posted June 25, 2006 Posted June 25, 2006 I hope this is the right thread /forum to place this topic in. I'm trying to execute a .vbs file (double-click) on Windows 2000 Advanced Server with Service Pack 4 (on administrator account) and it gives me this startup error:Here is the entire contents (code) of the .vbs file when viewed via Notepad: (line by line)The highlighted text indicates changes that reflect my system requirements.I already have "Windows Script 5.6 for Windows XP and Windows 2000 " installed.So does anyone know what is wrong with my problem?Please help me get this code working so I can encode multiple AVI files. As always, your help is appreciated. Thank you.
Yzöwl Posted June 25, 2006 Posted June 25, 2006 (edited) strFullCommand = """C:\Program Files\vso\ConvertXtoDVD\ConvertXtoDVD.exe"" /file=" & strFullLocation & " /auto=true /close"<Edit>You may also find the quotes easier to grasp if you were to use the concatenation operator and a continuation character in this case.strFullCommand = """C:\Program Files\vso\ConvertXtoDVD\ConvertXtoDVD.exe""" &_ " /file=" & strFullLocation & " /auto=true /close"The first line would show your file name using the "" convention to signify the set of double quotes, ("), within the quoted string, due to the space in the filename path.</Edit> Edited June 25, 2006 by Yzöwl
gunsmokingman Posted June 25, 2006 Posted June 25, 2006 Since I do not know the purpose of your script here is what I wrote up for you to try.You may have to make some changes.Dim Act : Set Act = CreateObject("Wscript.Shell") Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject") Dim ObjFolder : Set ObjFolder = Fso.GetFolder("D:\MyAviFiles") Dim ColFiles : Set ColFiles = ObjFolder.Files Dim Cmd1 : Cmd1 = Act.ExpandEnvironmentStrings("%Programfiles%\Vso\ConverXtoDVD\ConverXToDVD.Exe") Dim ObjFile For Each ObjFile In ColFiles If Fso.FileExists(Cmd1) Then Act.Run(Cmd1 & " /auto=true /close " & ObjFile.Path), 1 , True End If Next
Stealth3si Posted June 26, 2006 Author Posted June 26, 2006 strFullCommand = """C:\Program Files\vso\ConvertXtoDVD\ConvertXtoDVD.exe"" /file=" & strFullLocation & " /auto=true /close"<Edit>You may also find the quotes easier to grasp if you were to use the concatenation operator and a continuation character in this case.strFullCommand = """C:\Program Files\vso\ConvertXtoDVD\ConvertXtoDVD.exe""" &_ " /file=" & strFullLocation & " /auto=true /close"The first line would show your file name using the "" convention to signify the set of double quotes, ("), within the quoted string, due to the space in the filename path.</Edit>OK we're getting somewhere but the program only loads one file at a time. I want the program to load all the files in my folder.
Stealth3si Posted June 26, 2006 Author Posted June 26, 2006 Ok i already figured out the whole thing. The only problem I have is the program is too stubborn to auto-close, which is on the program's fault. So i'll have to wait for another update release of the program for it to work properly. THanks anyway.
Yzöwl Posted June 26, 2006 Posted June 26, 2006 From my understanding of the program you are using, should you not be using a file listing like this:"C:\Program Files\vso\ConvertXtoDVD\ConvertXtoDvd.exe" /fl=filelist.txt /auto=true /closeIf so you may be able to use:If wscript.Arguments.Count = 0 then msgbox "drop a Directory onto me..." Wscript.QuitEnd Ifobjin = wscript.Arguments(0)Const TemporaryFolder = 2Set wshell = wScript.CreateObject("WScript.Shell")Set fileobj = CreateObject("Scripting.FileSystemObject")Set objfolder = fileobj.GetFolder(objin)Set filelist = objfolder.filesSet tfolder = fileobj.GetSpecialFolder(TemporaryFolder) With wshell.CreateShortcut("none.lnk") .TargetPath = tfolder.Path temppath = .TargetPath & "\"End Withtfile = "filelist.txt"Set filetxt = fileobj.CreateTextFile(temppath & tfile, true)For Each f In filelist filetxt.writeline chr(34) & f.path & chr(34)Nextstrexe = wshell.ExpandEnvironmentStrings("%ProgramFiles%\vso\ConvertXtoDVD\" &_ "ConvertXtoDvd.exe")strarg = " /fl=" & chr(34) & temppath & tfile & chr(34) & " /auto=true /close"wshell.Run(strexe & strarg, 1, true)I don't know the program so you may need to remove or add double quotes in places, but it shouldn't be too far away. To use it just drop your folder containing your files to be added onto the vbs file.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now