![]() ![]() |
| Guest_StephenM_* |
Dec 28 2007, 03:12 AM
Post
#1
|
|
Guests |
I am trying to create a post task script that Moves a file from it local path to a network path.
The script I have created move.vbs works fine when run from the cmd line or from batch but will not work from webscheduler. The script is trying to maintain the folder structure "My Program\(2007-12-27 (17-05)) My Program Chan10" I am using the following command "C:\Program Files\DVB Web Scheduler Pro\Tasks\Move.vbs" "$filename" to execute the script The Error I get in websceduler is CODE Current Status Task : Move Files Create : 07/12/27 16:51:37 ("C:\Program Files\DVB Web Scheduler Pro\Tasks\Move.vbs" "C:\Data Folder\Streaming\TV\My Wife and Kids\(2007-12-27 (15-56)) My Wife and Kids Virgin1.ts") 07/12/27 16:51:37 :- Command is delaying for 5 seconds 07/12/27 16:51:42 :- Delay over 07/12/27 16:51:42 :- Executing command 07/12/27 16:51:44 :- External app exited with : null 07/12/27 16:51:44 :- Command finished 07/12/27 16:51:44 :- Time taken = 00:00:02 Application Standard Output Application Error Output Error running command. java.io.IOException: Cannot run program ""C:\Program": CreateProcess error=193, %1 is not a valid Win32 application at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at CommandWaitThread.run(CommandWaitThread.java:73) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 6 more The Script code (attached) I have created is CODE 'Retrieve Parameters from command line Dim ArgObj, var1, var2 Set ArgObj = WScript.Arguments 'First parameter var1 = ArgObj(0) 'Second parameter 'var2 = ArgObj(1) set ArgObj = Nothing dim filesys, filetomove, objFolder Dim SourceFile, DestinationDir, FinalDestination SourceFile = var1 DestinationDir = "\\Mybookworld\media\TV\" dim MySplit MySplit = split(SourceFile,"\") 'sourcefile = """" & SourceFile & """" FinalDestination = DestinationDir & MySplit(4) & "\" 'FinalDestination = """" & FinalDestination & """" 'Set scripting object set filesys = CreateObject ("Scripting.FileSystemObject") 'Log dim logfile set logFile = filesys.CreateTextFile("C:\movelog.txt") logFile.WriteLine("Source :" & SourceFile & " Destination :" & FinalDestination) 'Create Sub Folder IF NOT filesys.FolderExists(FinalDestination) then set objFolder = filesys.CreateFolder(FinalDestination) logFile.WriteLine("Folder Created") END IF set filetomove = filesys.GetFile(SourceFile) logFile.WriteLine("File Moved") filetomove.Move (FinalDestination) logFile.Close Please help
Attached File(s)
|
|
|
|
Dec 28 2007, 07:01 AM
Post
#2
|
|
|
Web Scheduler Developer Group: Developers Posts: 4,495 Joined: 9-July 03 From: Melb Member No.: 9 Card: None |
Try the following as the command:
C:\Program Files\DVB Web Scheduler Pro\Tasks\Move.vbs "$filename" |
|
|
|
| Guest_dractry_* |
Aug 19 2008, 11:37 PM
Post
#3
|
|
Guests |
|
|
|
|
Aug 25 2008, 09:27 PM
Post
#4
|
|
|
Participant Group: New Members Posts: 11 Joined: 9-March 08 Member No.: 9,782 Card: Terratec DT2400i |
I have had the same issues as stephen m regarding moving a file to a network path. Null pointers suggestion did not work either. Anyone found a solution yet? Probably .vbs is not correctly registered as an executable extension. Try this : C:\WINDOWS\system32\cscript.exe "C:\Program Files\DVB Web Scheduler Pro\Tasks\Move.vbs" "$filename" or cscript.exe "C:\Program Files\DVB Web Scheduler Pro\Tasks\Move.vbs" "$filename" Luca. |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 21st May 2013 - 06:08 PM |