home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
General Forums
OffTopic
NAS Start Up VBScript
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="PeterDB" data-source="post: 599617" data-attributes="member: 103437"><p>I have been using MediaPortal for a few days now and I love it.</p><p></p><p>I am using my setup with a QNAP TS-419p NAS with 8TB (running RAID 5 so 5.6 TB) with an Asrock ION330 Pro upgraded to 4GB memory, but when the NAS is in sleep mode it will take maybe 15-30 seconds for it to start up and the files be accessible and in this time MediaPortal often tends to crash or hang until the NAS is woken up.</p><p></p><p>So, I wrote a small VBScript which creates a small file and then starts a program afterwards. This program can be used to create a file on the NAS and then start MediaPortal, thus avoiding any issues.</p><p></p><p>Take the code below and copy it into a file called say NASon.vbs. It is important that the file extension is vbs!</p><p></p><p>You can now modify strPath, strFile and strExecuteProgram to specify respectively what the path should be, what file name should be and what the executed program should be.</p><p></p><p>Now when you need to start MediaPortal just run this file... </p><p></p><p></p><p>[CODE]'------------------------------------------------------------------------------------</p><p>' Created by Peter DeBrass (http://debrass.net)</p><p>' This small script is designed to create a file on the specified path and include</p><p>' the time when the script started and when the file was written.</p><p>' The purpose is has various types of NAS devices to power up before starting a</p><p>' program, such as MediaPortal.</p><p>'------------------------------------------------------------------------------------</p><p></p><p>'Various needed variables.</p><p>Dim strPath, strFileName, strStartDate, strStartTime, strExecuteProgram</p><p></p><p>'-----------------------------------------------------------------------------------------</p><p>' Please specify the precise path to the file which needs to be created, e.g., \\NAS\PATH\</p><p>'-----------------------------------------------------------------------------------------</p><p>strPath = "\\NAS\PATH\"</p><p>'-----------------------------------------------------------------------------------------</p><p>' Please provide a name to the file which needs to be created, e.g., NameOfFile</p><p>'-----------------------------------------------------------------------------------------</p><p>strFileName = "NASon"</p><p>'-----------------------------------------------------------------------------------------</p><p>' Please provide the full path to the program which needs to executed,</p><p>' e.g., C:\Program Files\Team MediaPortal\mp.exe</p><p>'-----------------------------------------------------------------------------------------</p><p>strExecuteProgram = "notepad"</p><p>'-----------------------------------------------------------------------------------------</p><p></p><p>'--DO NOT CHANGE ANYTHING BELOW THIS LINE UNLESS YOU NOW WHAT YOU ARE DOING---------------</p><p></p><p>'The Date and Time this script was started</p><p>strStartDate = Date</p><p>strStartTime = Time</p><p></p><p>'File Object Creation</p><p>Set FSO = CreateObject("Scripting.FileSystemObject")</p><p></p><p>'File Created</p><p>Set lf = FSO.OpenTextFile( strPath & strFileName & ".txt", 8, True)</p><p></p><p>'Information when this script was started and when the file creation was completed is written into the file.</p><p>lf.WriteLine("-----------------------------------" & VbCrLf & "Script Start:" & VBTab & strStartDate & " " & strStartTime & VbCrLf & "File Write:" & VBTab & Date & " " & Time & VbCrLf & "-----------------------------------")</p><p>lf.Close</p><p></p><p>'The program is started</p><p>Set ss = CreateObject("WScript.Shell")</p><p>ss.run strExecuteProgram,1</p><p>Set ss = nothing[/CODE]</p></blockquote><p></p>
[QUOTE="PeterDB, post: 599617, member: 103437"] I have been using MediaPortal for a few days now and I love it. I am using my setup with a QNAP TS-419p NAS with 8TB (running RAID 5 so 5.6 TB) with an Asrock ION330 Pro upgraded to 4GB memory, but when the NAS is in sleep mode it will take maybe 15-30 seconds for it to start up and the files be accessible and in this time MediaPortal often tends to crash or hang until the NAS is woken up. So, I wrote a small VBScript which creates a small file and then starts a program afterwards. This program can be used to create a file on the NAS and then start MediaPortal, thus avoiding any issues. Take the code below and copy it into a file called say NASon.vbs. It is important that the file extension is vbs! You can now modify strPath, strFile and strExecuteProgram to specify respectively what the path should be, what file name should be and what the executed program should be. Now when you need to start MediaPortal just run this file... [CODE]'------------------------------------------------------------------------------------ ' Created by Peter DeBrass (http://debrass.net) ' This small script is designed to create a file on the specified path and include ' the time when the script started and when the file was written. ' The purpose is has various types of NAS devices to power up before starting a ' program, such as MediaPortal. '------------------------------------------------------------------------------------ 'Various needed variables. Dim strPath, strFileName, strStartDate, strStartTime, strExecuteProgram '----------------------------------------------------------------------------------------- ' Please specify the precise path to the file which needs to be created, e.g., \\NAS\PATH\ '----------------------------------------------------------------------------------------- strPath = "\\NAS\PATH\" '----------------------------------------------------------------------------------------- ' Please provide a name to the file which needs to be created, e.g., NameOfFile '----------------------------------------------------------------------------------------- strFileName = "NASon" '----------------------------------------------------------------------------------------- ' Please provide the full path to the program which needs to executed, ' e.g., C:\Program Files\Team MediaPortal\mp.exe '----------------------------------------------------------------------------------------- strExecuteProgram = "notepad" '----------------------------------------------------------------------------------------- '--DO NOT CHANGE ANYTHING BELOW THIS LINE UNLESS YOU NOW WHAT YOU ARE DOING--------------- 'The Date and Time this script was started strStartDate = Date strStartTime = Time 'File Object Creation Set FSO = CreateObject("Scripting.FileSystemObject") 'File Created Set lf = FSO.OpenTextFile( strPath & strFileName & ".txt", 8, True) 'Information when this script was started and when the file creation was completed is written into the file. lf.WriteLine("-----------------------------------" & VbCrLf & "Script Start:" & VBTab & strStartDate & " " & strStartTime & VbCrLf & "File Write:" & VBTab & Date & " " & Time & VbCrLf & "-----------------------------------") lf.Close 'The program is started Set ss = CreateObject("WScript.Shell") ss.run strExecuteProgram,1 Set ss = nothing[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
General Forums
OffTopic
NAS Start Up VBScript
Contact us
RSS
Top
Bottom