![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Task Scheduler Problem I have a vbs script that I use to copy files from my local drive to a network drive as a backup. The script works fine on its own (by double-clicking it or by running it from the command prompt). I created a scheduled task to have it run automatically, but it doesn't seem to work. It says that it completed successfully, but it didn't really do anything. Even if I select it in the Task Scheduler and then click "Run" in the Actions pane, it says it's status is "Running", but nothing is happening. What am I doing wrong? Thanks, Keith |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Task Scheduler Problem Create a script or bat file that runs the command: runas /user:<yourUserName> "cscript \"yourScript.VBS\" " -- Was this helpful? Then click the Ratings button. Voting helps the web interface. http://www.microsoft.com/wn3/locales...eAPostAsAnswer Mark L. Ferguson .. "Keith" <Keith@xxxxxx> wrote in message news:6C1064A5-5A80-4970-A1DB-58C0A05A8415@xxxxxx Quote: > I have a vbs script that I use to copy files from my local drive to a > network > drive as a backup. The script works fine on its own (by double-clicking > it > or by running it from the command prompt). I created a scheduled task to > have it run automatically, but it doesn't seem to work. It says that it > completed successfully, but it didn't really do anything. Even if I > select > it in the Task Scheduler and then click "Run" in the Actions pane, it says > it's status is "Running", but nothing is happening. What am I doing > wrong? > > Thanks, > > Keith |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Task Scheduler Problem Mark, Thanks for the response. I tried creating a script which calls my script as you suggested, and then created a scheduled task to run that new script, but I got the same result. Do you have any other suggestions? Thanks, Keith "Mark L. Ferguson" wrote: Quote: > Create a script or bat file that runs the command: > runas /user:<yourUserName> "cscript \"yourScript.VBS\" " > > -- > Was this helpful? Then click the Ratings button. Voting helps the web > interface. > http://www.microsoft.com/wn3/locales...eAPostAsAnswer > Mark L. Ferguson > . > > "Keith" <Keith@xxxxxx> wrote in message > news:6C1064A5-5A80-4970-A1DB-58C0A05A8415@xxxxxx Quote: > > I have a vbs script that I use to copy files from my local drive to a > > network > > drive as a backup. The script works fine on its own (by double-clicking > > it > > or by running it from the command prompt). I created a scheduled task to > > have it run automatically, but it doesn't seem to work. It says that it > > completed successfully, but it didn't really do anything. Even if I > > select > > it in the Task Scheduler and then click "Run" in the Actions pane, it says > > it's status is "Running", but nothing is happening. What am I doing > > wrong? > > > > Thanks, > > > > Keith |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Task Scheduler Problem It's very likely that the script won't run because it's calling something that needs you to 'run as administrator'. There are several ways you might accomplish this, but I'm not sure which one would work from Scheduled Tasks. One direct method might be to enable the default admin, and 'runas' that user. Go to Start/all programs/accessories/run, and type: control userpasswords2 Advanced tab, Advanced button, Users folder, rightclick Administrator, Properties, uncheck checkbox for "Account is disabled" Restart Windows. There could be other methods, but 'runas /user:Administrator ...' would be tested this way and you could look for other ways to accomplish this. -- Was this helpful? Then click the Ratings button. Voting helps the web interface. http://www.microsoft.com/wn3/locales...eAPostAsAnswer Mark L. Ferguson .. "Keith" <Keith@xxxxxx> wrote in message news:747F1A15-4206-466E-9679-AA6060305894@xxxxxx Quote: > Mark, > > Thanks for the response. I tried creating a script which calls my script > as > you suggested, and then created a scheduled task to run that new script, > but > I got the same result. Do you have any other suggestions? > > Thanks, > > Keith > > > "Mark L. Ferguson" wrote: > Quote: >> Create a script or bat file that runs the command: >> runas /user:<yourUserName> "cscript \"yourScript.VBS\" " >> >> -- >> Was this helpful? Then click the Ratings button. Voting helps the web >> interface. >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer >> Mark L. Ferguson >> . >> >> "Keith" <Keith@xxxxxx> wrote in message >> news:6C1064A5-5A80-4970-A1DB-58C0A05A8415@xxxxxx Quote: >> > I have a vbs script that I use to copy files from my local drive to a >> > network >> > drive as a backup. The script works fine on its own (by >> > double-clicking >> > it >> > or by running it from the command prompt). I created a scheduled task >> > to >> > have it run automatically, but it doesn't seem to work. It says that >> > it >> > completed successfully, but it didn't really do anything. Even if I >> > select >> > it in the Task Scheduler and then click "Run" in the Actions pane, it >> > says >> > it's status is "Running", but nothing is happening. What am I doing >> > wrong? >> > >> > Thanks, >> > >> > Keith |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Task Scheduler Problem Mark, Thanks again for your input. I enabled the default Administrator as you suggested, but I'm not sure what that will do. I have another vbs script that also doesn't work properly. All it's supposed to do is pop up a msgbox reminding me to do something. What's weird is that the backup one I originally posted about says that it completed successfully, even though it didn't do anything. I never receive any error message, it just doesn't do what it's supposed to. Following is the script for the backup, just in case that helps: Dim PathVar Dim RefNo Dim objFSO Dim objShell Dim ShellString Dim retvalue Dim VarFilename set objShell = Wscript.CreateObject("Wscript.Shell") VarFilename= "xcopy " & chr(34) & "C:\Users\kgrabske\Documents\*.*" & chr(34) & chr(32) & chr(34) & "Z:\backup\Keith\Documents\*.*" & chr(34) VarFilename=VarFilename & " /e /y /c /h /d /EXCLUDE:C:\Users\kgrabske\Documents\BackupExclusions.txt" objShell.run VarFilename There isn't much to it, and I can't figure out why special permissions would be required. I am already running the task using my login, and I am an administrator. Do you have any other thoughts? I may see if Macro Scheduler will work. I used to use that a lot, but I moved away from it in favor of XP's scheduled tasks, which see to work much better than Vista's. Thanks, Keith "Mark L. Ferguson" wrote: Quote: > It's very likely that the script won't run because it's calling something > that needs you to 'run as administrator'. There are several ways you might > accomplish this, but I'm not sure which one would work from Scheduled Tasks. > One direct method might be to enable the default admin, and 'runas' that > user. > Go to Start/all programs/accessories/run, and type: > > control userpasswords2 > > Advanced tab, Advanced button, Users folder, rightclick Administrator, > Properties, uncheck checkbox for "Account is disabled" > Restart Windows. > > There could be other methods, but 'runas /user:Administrator ...' would be > tested this way and you could look for other ways to accomplish this. > -- > Was this helpful? Then click the Ratings button. Voting helps the web > interface. > http://www.microsoft.com/wn3/locales...eAPostAsAnswer > Mark L. Ferguson > .. > > "Keith" <Keith@xxxxxx> wrote in message > news:747F1A15-4206-466E-9679-AA6060305894@xxxxxx Quote: > > Mark, > > > > Thanks for the response. I tried creating a script which calls my script > > as > > you suggested, and then created a scheduled task to run that new script, > > but > > I got the same result. Do you have any other suggestions? > > > > Thanks, > > > > Keith > > > > > > "Mark L. Ferguson" wrote: > > Quote: > >> Create a script or bat file that runs the command: > >> runas /user:<yourUserName> "cscript \"yourScript.VBS\" " > >> > >> -- > >> Was this helpful? Then click the Ratings button. Voting helps the web > >> interface. > >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer > >> Mark L. Ferguson > >> . > >> > >> "Keith" <Keith@xxxxxx> wrote in message > >> news:6C1064A5-5A80-4970-A1DB-58C0A05A8415@xxxxxx > >> > I have a vbs script that I use to copy files from my local drive to a > >> > network > >> > drive as a backup. The script works fine on its own (by > >> > double-clicking > >> > it > >> > or by running it from the command prompt). I created a scheduled task > >> > to > >> > have it run automatically, but it doesn't seem to work. It says that > >> > it > >> > completed successfully, but it didn't really do anything. Even if I > >> > select > >> > it in the Task Scheduler and then click "Run" in the Actions pane, it > >> > says > >> > it's status is "Running", but nothing is happening. What am I doing > >> > wrong? > >> > > >> > Thanks, > >> > > >> > Keith > >> |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Task Scheduler Problem I would log on as default "Administrator" and schedule the task., or at least test the run. If it's a permissions error, that should solve it. -- Was this helpful? Then click the Ratings button. Voting helps the web interface. http://www.microsoft.com/wn3/locales...eAPostAsAnswer Mark L. Ferguson .. "Keith" <Keith@xxxxxx> wrote in message news:6F83A395-D52F-4458-A692-6DCFA611F76C@xxxxxx Quote: > Mark, > > Thanks again for your input. I enabled the default Administrator as you > suggested, but I'm not sure what that will do. I have another vbs script > that also doesn't work properly. All it's supposed to do is pop up a > msgbox > reminding me to do something. What's weird is that the backup one I > originally posted about says that it completed successfully, even though > it > didn't do anything. I never receive any error message, it just doesn't do > what it's supposed to. > > Following is the script for the backup, just in case that helps: > > Dim PathVar > Dim RefNo > Dim objFSO > Dim objShell > Dim ShellString > Dim retvalue > Dim VarFilename > > set objShell = Wscript.CreateObject("Wscript.Shell") > > VarFilename= "xcopy " & chr(34) & "C:\Users\kgrabske\Documents\*.*" & > chr(34) & chr(32) & chr(34) & "Z:\backup\Keith\Documents\*.*" & chr(34) > VarFilename=VarFilename & " /e /y /c /h /d > /EXCLUDE:C:\Users\kgrabske\Documents\BackupExclusions.txt" > > objShell.run VarFilename > > There isn't much to it, and I can't figure out why special permissions > would > be required. I am already running the task using my login, and I am an > administrator. > > Do you have any other thoughts? I may see if Macro Scheduler will work. > I > used to use that a lot, but I moved away from it in favor of XP's > scheduled > tasks, which see to work much better than Vista's. > > Thanks, > > Keith > > > "Mark L. Ferguson" wrote: > Quote: >> It's very likely that the script won't run because it's calling something >> that needs you to 'run as administrator'. There are several ways you >> might >> accomplish this, but I'm not sure which one would work from Scheduled >> Tasks. >> One direct method might be to enable the default admin, and 'runas' that >> user. >> Go to Start/all programs/accessories/run, and type: >> >> control userpasswords2 >> >> Advanced tab, Advanced button, Users folder, rightclick Administrator, >> Properties, uncheck checkbox for "Account is disabled" >> Restart Windows. >> >> There could be other methods, but 'runas /user:Administrator ...' would >> be >> tested this way and you could look for other ways to accomplish this. >> -- >> Was this helpful? Then click the Ratings button. Voting helps the web >> interface. >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer >> Mark L. Ferguson >> .. >> >> "Keith" <Keith@xxxxxx> wrote in message >> news:747F1A15-4206-466E-9679-AA6060305894@xxxxxx Quote: >> > Mark, >> > >> > Thanks for the response. I tried creating a script which calls my >> > script >> > as >> > you suggested, and then created a scheduled task to run that new >> > script, >> > but >> > I got the same result. Do you have any other suggestions? >> > >> > Thanks, >> > >> > Keith >> > >> > >> > "Mark L. Ferguson" wrote: >> > >> >> Create a script or bat file that runs the command: >> >> runas /user:<yourUserName> "cscript \"yourScript.VBS\" " >> >> >> >> -- >> >> Was this helpful? Then click the Ratings button. Voting helps the web >> >> interface. >> >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer >> >> Mark L. Ferguson >> >> . >> >> >> >> "Keith" <Keith@xxxxxx> wrote in message >> >> news:6C1064A5-5A80-4970-A1DB-58C0A05A8415@xxxxxx >> >> > I have a vbs script that I use to copy files from my local drive to >> >> > a >> >> > network >> >> > drive as a backup. The script works fine on its own (by >> >> > double-clicking >> >> > it >> >> > or by running it from the command prompt). I created a scheduled >> >> > task >> >> > to >> >> > have it run automatically, but it doesn't seem to work. It says >> >> > that >> >> > it >> >> > completed successfully, but it didn't really do anything. Even if I >> >> > select >> >> > it in the Task Scheduler and then click "Run" in the Actions pane, >> >> > it >> >> > says >> >> > it's status is "Running", but nothing is happening. What am I doing >> >> > wrong? >> >> > >> >> > Thanks, >> >> > >> >> > Keith >> >> |
My System Specs![]() |
| | #7 (permalink) |
| | Re: Task Scheduler Problem Mark, I tried logging on as administrator, and my scheduled task did the same thing. Then I created a new scheduled task while still logged on as administrator, and I got the same results...task completed when nothing actually happened. Unless I can come up with a solution to this problem soon, I will have to investigate alternatives like Macro Scheduler. I suppose there's no guarantee that it will work any better, but I've got to do something. Thanks again for all of your help. I really appreciate it, even if we haven't yet come up with a solution. Sincerely, Keith "Mark L. Ferguson" wrote: Quote: > I would log on as default "Administrator" and schedule the task., or at > least test the run. > If it's a permissions error, that should solve it. > -- > Was this helpful? Then click the Ratings button. Voting helps the web > interface. > http://www.microsoft.com/wn3/locales...eAPostAsAnswer > Mark L. Ferguson > .. > > "Keith" <Keith@xxxxxx> wrote in message > news:6F83A395-D52F-4458-A692-6DCFA611F76C@xxxxxx Quote: > > Mark, > > > > Thanks again for your input. I enabled the default Administrator as you > > suggested, but I'm not sure what that will do. I have another vbs script > > that also doesn't work properly. All it's supposed to do is pop up a > > msgbox > > reminding me to do something. What's weird is that the backup one I > > originally posted about says that it completed successfully, even though > > it > > didn't do anything. I never receive any error message, it just doesn't do > > what it's supposed to. > > > > Following is the script for the backup, just in case that helps: > > > > Dim PathVar > > Dim RefNo > > Dim objFSO > > Dim objShell > > Dim ShellString > > Dim retvalue > > Dim VarFilename > > > > set objShell = Wscript.CreateObject("Wscript.Shell") > > > > VarFilename= "xcopy " & chr(34) & "C:\Users\kgrabske\Documents\*.*" & > > chr(34) & chr(32) & chr(34) & "Z:\backup\Keith\Documents\*.*" & chr(34) > > VarFilename=VarFilename & " /e /y /c /h /d > > /EXCLUDE:C:\Users\kgrabske\Documents\BackupExclusions.txt" > > > > objShell.run VarFilename > > > > There isn't much to it, and I can't figure out why special permissions > > would > > be required. I am already running the task using my login, and I am an > > administrator. > > > > Do you have any other thoughts? I may see if Macro Scheduler will work. > > I > > used to use that a lot, but I moved away from it in favor of XP's > > scheduled > > tasks, which see to work much better than Vista's. > > > > Thanks, > > > > Keith > > > > > > "Mark L. Ferguson" wrote: > > Quote: > >> It's very likely that the script won't run because it's calling something > >> that needs you to 'run as administrator'. There are several ways you > >> might > >> accomplish this, but I'm not sure which one would work from Scheduled > >> Tasks. > >> One direct method might be to enable the default admin, and 'runas' that > >> user. > >> Go to Start/all programs/accessories/run, and type: > >> > >> control userpasswords2 > >> > >> Advanced tab, Advanced button, Users folder, rightclick Administrator, > >> Properties, uncheck checkbox for "Account is disabled" > >> Restart Windows. > >> > >> There could be other methods, but 'runas /user:Administrator ...' would > >> be > >> tested this way and you could look for other ways to accomplish this. > >> -- > >> Was this helpful? Then click the Ratings button. Voting helps the web > >> interface. > >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer > >> Mark L. Ferguson > >> .. > >> > >> "Keith" <Keith@xxxxxx> wrote in message > >> news:747F1A15-4206-466E-9679-AA6060305894@xxxxxx > >> > Mark, > >> > > >> > Thanks for the response. I tried creating a script which calls my > >> > script > >> > as > >> > you suggested, and then created a scheduled task to run that new > >> > script, > >> > but > >> > I got the same result. Do you have any other suggestions? > >> > > >> > Thanks, > >> > > >> > Keith > >> > > >> > > >> > "Mark L. Ferguson" wrote: > >> > > >> >> Create a script or bat file that runs the command: > >> >> runas /user:<yourUserName> "cscript \"yourScript.VBS\" " > >> >> > >> >> -- > >> >> Was this helpful? Then click the Ratings button. Voting helps the web > >> >> interface. > >> >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer > >> >> Mark L. Ferguson > >> >> . > >> >> > >> >> "Keith" <Keith@xxxxxx> wrote in message > >> >> news:6C1064A5-5A80-4970-A1DB-58C0A05A8415@xxxxxx > >> >> > I have a vbs script that I use to copy files from my local drive to > >> >> > a > >> >> > network > >> >> > drive as a backup. The script works fine on its own (by > >> >> > double-clicking > >> >> > it > >> >> > or by running it from the command prompt). I created a scheduled > >> >> > task > >> >> > to > >> >> > have it run automatically, but it doesn't seem to work. It says > >> >> > that > >> >> > it > >> >> > completed successfully, but it didn't really do anything. Even if I > >> >> > select > >> >> > it in the Task Scheduler and then click "Run" in the Actions pane, > >> >> > it > >> >> > says > >> >> > it's status is "Running", but nothing is happening. What am I doing > >> >> > wrong? > >> >> > > >> >> > Thanks, > >> >> > > >> >> > Keith > >> >> > >> |
My System Specs![]() |
| | #8 (permalink) |
| | Re: Task Scheduler Problem It's acting like you get 'access denied' on the xcopy, but that other script's failure on simply running a popup dialog indicates something deeper. You don't get the wscript object at all. I would say that indicates a Policy setting against script, except that you can run a script in other than Scheduled Tasks. Let's write a vbs that runs in CScript, with some echos, to get a console window. command: cscript go.vbs --go.vbs-- wscript.sleep 1000 wscript.echo "Echo works" wscript.sleep 1000 shell=createobject("wscript.shell") if shell is nothing then wscript.echo "No Shell" end if wscript.sleep 3000 wscript.exit --end file- -- Was this helpful? Then click the Ratings button. Voting helps the web interface. http://www.microsoft.com/wn3/locales...eAPostAsAnswer Mark L. Ferguson .. "Keith" <Keith@xxxxxx> wrote in message news:4AFCE5F0-DE85-4FC3-A5BA-B39EC4DC1BA3@xxxxxx Quote: > Mark, > > I tried logging on as administrator, and my scheduled task did the same > thing. Then I created a new scheduled task while still logged on as > administrator, and I got the same results...task completed when nothing > actually happened. Unless I can come up with a solution to this problem > soon, I will have to investigate alternatives like Macro Scheduler. I > suppose there's no guarantee that it will work any better, but I've got to > do > something. > > Thanks again for all of your help. I really appreciate it, even if we > haven't yet come up with a solution. > > Sincerely, > > Keith > > > > > "Mark L. Ferguson" wrote: > Quote: >> I would log on as default "Administrator" and schedule the task., or at >> least test the run. >> If it's a permissions error, that should solve it. >> -- >> Was this helpful? Then click the Ratings button. Voting helps the web >> interface. >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer >> Mark L. Ferguson >> .. >> >> "Keith" <Keith@xxxxxx> wrote in message >> news:6F83A395-D52F-4458-A692-6DCFA611F76C@xxxxxx Quote: >> > Mark, >> > >> > Thanks again for your input. I enabled the default Administrator as >> > you >> > suggested, but I'm not sure what that will do. I have another vbs >> > script >> > that also doesn't work properly. All it's supposed to do is pop up a >> > msgbox >> > reminding me to do something. What's weird is that the backup one I >> > originally posted about says that it completed successfully, even >> > though >> > it >> > didn't do anything. I never receive any error message, it just doesn't >> > do >> > what it's supposed to. >> > >> > Following is the script for the backup, just in case that helps: >> > >> > Dim PathVar >> > Dim RefNo >> > Dim objFSO >> > Dim objShell >> > Dim ShellString >> > Dim retvalue >> > Dim VarFilename >> > >> > set objShell = Wscript.CreateObject("Wscript.Shell") >> > >> > VarFilename= "xcopy " & chr(34) & "C:\Users\kgrabske\Documents\*.*" & >> > chr(34) & chr(32) & chr(34) & "Z:\backup\Keith\Documents\*.*" & chr(34) >> > VarFilename=VarFilename & " /e /y /c /h /d >> > /EXCLUDE:C:\Users\kgrabske\Documents\BackupExclusions.txt" >> > >> > objShell.run VarFilename >> > >> > There isn't much to it, and I can't figure out why special permissions >> > would >> > be required. I am already running the task using my login, and I am an >> > administrator. >> > >> > Do you have any other thoughts? I may see if Macro Scheduler will >> > work. >> > I >> > used to use that a lot, but I moved away from it in favor of XP's >> > scheduled >> > tasks, which see to work much better than Vista's. >> > >> > Thanks, >> > >> > Keith >> > >> > >> > "Mark L. Ferguson" wrote: >> > >> >> It's very likely that the script won't run because it's calling >> >> something >> >> that needs you to 'run as administrator'. There are several ways you >> >> might >> >> accomplish this, but I'm not sure which one would work from Scheduled >> >> Tasks. >> >> One direct method might be to enable the default admin, and 'runas' >> >> that >> >> user. >> >> Go to Start/all programs/accessories/run, and type: >> >> >> >> control userpasswords2 >> >> >> >> Advanced tab, Advanced button, Users folder, rightclick Administrator, >> >> Properties, uncheck checkbox for "Account is disabled" >> >> Restart Windows. >> >> >> >> There could be other methods, but 'runas /user:Administrator ...' >> >> would >> >> be >> >> tested this way and you could look for other ways to accomplish this. >> >> -- >> >> Was this helpful? Then click the Ratings button. Voting helps the web >> >> interface. >> >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer >> >> Mark L. Ferguson >> >> .. >> >> >> >> "Keith" <Keith@xxxxxx> wrote in message >> >> news:747F1A15-4206-466E-9679-AA6060305894@xxxxxx >> >> > Mark, >> >> > >> >> > Thanks for the response. I tried creating a script which calls my >> >> > script >> >> > as >> >> > you suggested, and then created a scheduled task to run that new >> >> > script, >> >> > but >> >> > I got the same result. Do you have any other suggestions? >> >> > >> >> > Thanks, >> >> > >> >> > Keith >> >> > >> >> > >> >> > "Mark L. Ferguson" wrote: >> >> > >> >> >> Create a script or bat file that runs the command: >> >> >> runas /user:<yourUserName> "cscript \"yourScript.VBS\" " >> >> >> >> >> >> -- >> >> >> Was this helpful? Then click the Ratings button. Voting helps the >> >> >> web >> >> >> interface. >> >> >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer >> >> >> Mark L. Ferguson >> >> >> . >> >> >> >> >> >> "Keith" <Keith@xxxxxx> wrote in message >> >> >> news:6C1064A5-5A80-4970-A1DB-58C0A05A8415@xxxxxx >> >> >> > I have a vbs script that I use to copy files from my local drive >> >> >> > to >> >> >> > a >> >> >> > network >> >> >> > drive as a backup. The script works fine on its own (by >> >> >> > double-clicking >> >> >> > it >> >> >> > or by running it from the command prompt). I created a scheduled >> >> >> > task >> >> >> > to >> >> >> > have it run automatically, but it doesn't seem to work. It says >> >> >> > that >> >> >> > it >> >> >> > completed successfully, but it didn't really do anything. Even >> >> >> > if I >> >> >> > select >> >> >> > it in the Task Scheduler and then click "Run" in the Actions >> >> >> > pane, >> >> >> > it >> >> >> > says >> >> >> > it's status is "Running", but nothing is happening. What am I >> >> >> > doing >> >> >> > wrong? >> >> >> > >> >> >> > Thanks, >> >> >> > >> >> >> > Keith >> >> >> >> >> |
My System Specs![]() |
| | #9 (permalink) |
| | Re: Task Scheduler Problem Mark, I copied and pasted the code you supplied into a text file an then tried to run the script from the command line. Following are the results: --------------------------------------------------------------------------------------------- C:\Documents and Settings\kgrabske\Documents\AAScripts>cscript go.vbs Microsoft (R) Windows Script Host Version 5.7 Copyright (C) Microsoft Corporation. All rights reserved. Echo works C:\Documents and Settings\kgrabske\Documents\AAScripts\go.vbs(5, 1) Microsoft VB Script runtime error: Object doesn't support this property or method: 'shell' ------------------------------------------------------------------------------------------------ I'm not really an expert on scripting, but it looks like the problem is on the following line: shell=createobject("wscript.shell") Am I right in assuming that we need to get the script working from the command line before we can use it to test the Task Scheduler? Thanks, Keith "Mark L. Ferguson" wrote: Quote: > It's acting like you get 'access denied' on the xcopy, but that other > script's failure on simply running a popup dialog indicates something > deeper. You don't get the wscript object at all. I would say that indicates > a Policy setting against script, except that you can run a script in other > than Scheduled Tasks. > Let's write a vbs that runs in CScript, with some echos, to get a console > window. > command: cscript go.vbs > --go.vbs-- > wscript.sleep 1000 > wscript.echo "Echo works" > wscript.sleep 1000 > shell=createobject("wscript.shell") > if shell is nothing then > wscript.echo "No Shell" > end if > wscript.sleep 3000 > wscript.exit > --end file- > -- > Was this helpful? Then click the Ratings button. Voting helps the web > interface. > http://www.microsoft.com/wn3/locales...eAPostAsAnswer > Mark L. Ferguson > .. > > "Keith" <Keith@xxxxxx> wrote in message > news:4AFCE5F0-DE85-4FC3-A5BA-B39EC4DC1BA3@xxxxxx Quote: > > Mark, > > > > I tried logging on as administrator, and my scheduled task did the same > > thing. Then I created a new scheduled task while still logged on as > > administrator, and I got the same results...task completed when nothing > > actually happened. Unless I can come up with a solution to this problem > > soon, I will have to investigate alternatives like Macro Scheduler. I > > suppose there's no guarantee that it will work any better, but I've got to > > do > > something. > > > > Thanks again for all of your help. I really appreciate it, even if we > > haven't yet come up with a solution. > > > > Sincerely, > > > > Keith > > > > > > > > > > "Mark L. Ferguson" wrote: > > Quote: > >> I would log on as default "Administrator" and schedule the task., or at > >> least test the run. > >> If it's a permissions error, that should solve it. > >> -- > >> Was this helpful? Then click the Ratings button. Voting helps the web > >> interface. > >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer > >> Mark L. Ferguson > >> .. > >> > >> "Keith" <Keith@xxxxxx> wrote in message > >> news:6F83A395-D52F-4458-A692-6DCFA611F76C@xxxxxx > >> > Mark, > >> > > >> > Thanks again for your input. I enabled the default Administrator as > >> > you > >> > suggested, but I'm not sure what that will do. I have another vbs > >> > script > >> > that also doesn't work properly. All it's supposed to do is pop up a > >> > msgbox > >> > reminding me to do something. What's weird is that the backup one I > >> > originally posted about says that it completed successfully, even > >> > though > >> > it > >> > didn't do anything. I never receive any error message, it just doesn't > >> > do > >> > what it's supposed to. > >> > > >> > Following is the script for the backup, just in case that helps: > >> > > >> > Dim PathVar > >> > Dim RefNo > >> > Dim objFSO > >> > Dim objShell > >> > Dim ShellString > >> > Dim retvalue > >> > Dim VarFilename > >> > > >> > set objShell = Wscript.CreateObject("Wscript.Shell") > >> > > >> > VarFilename= "xcopy " & chr(34) & "C:\Users\kgrabske\Documents\*.*" & > >> > chr(34) & chr(32) & chr(34) & "Z:\backup\Keith\Documents\*.*" & chr(34) > >> > VarFilename=VarFilename & " /e /y /c /h /d > >> > /EXCLUDE:C:\Users\kgrabske\Documents\BackupExclusions.txt" > >> > > >> > objShell.run VarFilename > >> > > >> > There isn't much to it, and I can't figure out why special permissions > >> > would > >> > be required. I am already running the task using my login, and I am an > >> > administrator. > >> > > >> > Do you have any other thoughts? I may see if Macro Scheduler will > >> > work. > >> > I > >> > used to use that a lot, but I moved away from it in favor of XP's > >> > scheduled > >> > tasks, which see to work much better than Vista's. > >> > > >> > Thanks, > >> > > >> > Keith > >> > > >> > > >> > "Mark L. Ferguson" wrote: > >> > > >> >> It's very likely that the script won't run because it's calling > >> >> something > >> >> that needs you to 'run as administrator'. There are several ways you > >> >> might > >> >> accomplish this, but I'm not sure which one would work from Scheduled > >> >> Tasks. > >> >> One direct method might be to enable the default admin, and 'runas' > >> >> that > >> >> user. > >> >> Go to Start/all programs/accessories/run, and type: > >> >> > >> >> control userpasswords2 > >> >> > >> >> Advanced tab, Advanced button, Users folder, rightclick Administrator, > >> >> Properties, uncheck checkbox for "Account is disabled" > >> >> Restart Windows. > >> >> > >> >> There could be other methods, but 'runas /user:Administrator ...' > >> >> would > >> >> be > >> >> tested this way and you could look for other ways to accomplish this. > >> >> -- > >> >> Was this helpful? Then click the Ratings button. Voting helps the web > >> >> interface. > >> >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer > >> >> Mark L. Ferguson > >> >> .. > >> >> > >> >> "Keith" <Keith@xxxxxx> wrote in message > >> >> news:747F1A15-4206-466E-9679-AA6060305894@xxxxxx > >> >> > Mark, > >> >> > > >> >> > Thanks for the response. I tried creating a script which calls my > >> >> > script > >> >> > as > >> >> > you suggested, and then created a scheduled task to run that new > >> >> > script, > >> >> > but > >> >> > I got the same result. Do you have any other suggestions? > >> >> > > >> >> > Thanks, > >> >> > > >> >> > Keith > >> >> > > >> >> > > >> >> > "Mark L. Ferguson" wrote: > >> >> > > >> >> >> Create a script or bat file that runs the command: > >> >> >> runas /user:<yourUserName> "cscript \"yourScript.VBS\" " > >> >> >> > >> >> >> -- > >> >> >> Was this helpful? Then click the Ratings button. Voting helps the > >> >> >> web > >> >> >> interface. > >> >> >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer > >> >> >> Mark L. Ferguson > >> >> >> . > >> >> >> > >> >> >> "Keith" <Keith@xxxxxx> wrote in message > >> >> >> news:6C1064A5-5A80-4970-A1DB-58C0A05A8415@xxxxxx > >> >> >> > I have a vbs script that I use to copy files from my local drive > >> >> >> > to > >> >> >> > a > >> >> >> > network > >> >> >> > drive as a backup. The script works fine on its own (by > >> >> >> > double-clicking > >> >> >> > it > >> >> >> > or by running it from the command prompt). I created a scheduled > >> >> >> > task > >> >> >> > to > >> >> >> > have it run automatically, but it doesn't seem to work. It says > >> >> >> > that > >> >> >> > it > >> >> >> > completed successfully, but it didn't really do anything. Even > >> >> >> > if I > >> >> >> > select > >> >> >> > it in the Task Scheduler and then click "Run" in the Actions > >> >> >> > pane, > >> >> >> > it > >> >> >> > says > >> >> >> > it's status is "Running", but nothing is happening. What am I > >> >> >> > doing > >> >> >> > wrong? > >> >> >> > > >> >> >> > Thanks, > >> >> >> > > >> >> >> > Keith > >> >> >> > >> >> > >> |
My System Specs![]() |
| | #10 (permalink) |
| | Re: Task Scheduler Problem yes, I missed the 'set' command. set shell=create... -- Was this helpful? Then click the Ratings button. Voting helps the web interface. http://www.microsoft.com/wn3/locales...eAPostAsAnswer Mark L. Ferguson .. "Keith" <Keith@xxxxxx> wrote in message news:AA069875-90ED-4068-97A6-24F5D817F39F@xxxxxx Quote: > Mark, > > I copied and pasted the code you supplied into a text file an then tried > to > run the script from the command line. Following are the results: > > --------------------------------------------------------------------------------------------- > C:\Documents and Settings\kgrabske\Documents\AAScripts>cscript go.vbs > Microsoft (R) Windows Script Host Version 5.7 > Copyright (C) Microsoft Corporation. All rights reserved. > > Echo works > C:\Documents and Settings\kgrabske\Documents\AAScripts\go.vbs(5, 1) > Microsoft VB > Script runtime error: Object doesn't support this property or method: > 'shell' > ------------------------------------------------------------------------------------------------ > > I'm not really an expert on scripting, but it looks like the problem is on > the following line: > > shell=createobject("wscript.shell") > > Am I right in assuming that we need to get the script working from the > command line before we can use it to test the Task Scheduler? > > Thanks, > > Keith > > > > > > "Mark L. Ferguson" wrote: > Quote: >> It's acting like you get 'access denied' on the xcopy, but that other >> script's failure on simply running a popup dialog indicates something >> deeper. You don't get the wscript object at all. I would say that >> indicates >> a Policy setting against script, except that you can run a script in >> other >> than Scheduled Tasks. >> Let's write a vbs that runs in CScript, with some echos, to get a console >> window. >> command: cscript go.vbs >> --go.vbs-- >> wscript.sleep 1000 >> wscript.echo "Echo works" >> wscript.sleep 1000 >> shell=createobject("wscript.shell") >> if shell is nothing then >> wscript.echo "No Shell" >> end if >> wscript.sleep 3000 >> wscript.exit >> --end file- >> -- >> Was this helpful? Then click the Ratings button. Voting helps the web >> interface. >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer >> Mark L. Ferguson >> .. >> >> "Keith" <Keith@xxxxxx> wrote in message >> news:4AFCE5F0-DE85-4FC3-A5BA-B39EC4DC1BA3@xxxxxx Quote: >> > Mark, >> > >> > I tried logging on as administrator, and my scheduled task did the same >> > thing. Then I created a new scheduled task while still logged on as >> > administrator, and I got the same results...task completed when nothing >> > actually happened. Unless I can come up with a solution to this >> > problem >> > soon, I will have to investigate alternatives like Macro Scheduler. I >> > suppose there's no guarantee that it will work any better, but I've got >> > to >> > do >> > something. >> > >> > Thanks again for all of your help. I really appreciate it, even if we >> > haven't yet come up with a solution. >> > >> > Sincerely, >> > >> > Keith >> > >> > >> > >> > >> > "Mark L. Ferguson" wrote: >> > >> >> I would log on as default "Administrator" and schedule the task., or >> >> at >> >> least test the run. >> >> If it's a permissions error, that should solve it. >> >> -- >> >> Was this helpful? Then click the Ratings button. Voting helps the web >> >> interface. >> >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer >> >> Mark L. Ferguson >> >> .. >> >> >> >> "Keith" <Keith@xxxxxx> wrote in message >> >> news:6F83A395-D52F-4458-A692-6DCFA611F76C@xxxxxx >> >> > Mark, >> >> > >> >> > Thanks again for your input. I enabled the default Administrator as >> >> > you >> >> > suggested, but I'm not sure what that will do. I have another vbs >> >> > script >> >> > that also doesn't work properly. All it's supposed to do is pop up >> >> > a >> >> > msgbox >> >> > reminding me to do something. What's weird is that the backup one I >> >> > originally posted about says that it completed successfully, even >> >> > though >> >> > it >> >> > didn't do anything. I never receive any error message, it just >> >> > doesn't >> >> > do >> >> > what it's supposed to. >> >> > >> >> > Following is the script for the backup, just in case that helps: >> >> > >> >> > Dim PathVar >> >> > Dim RefNo >> >> > Dim objFSO >> >> > Dim objShell >> >> > Dim ShellString >> >> > Dim retvalue >> >> > Dim VarFilename >> >> > >> >> > set objShell = Wscript.CreateObject("Wscript.Shell") >> >> > >> >> > VarFilename= "xcopy " & chr(34) & "C:\Users\kgrabske\Documents\*.*" >> >> > & >> >> > chr(34) & chr(32) & chr(34) & "Z:\backup\Keith\Documents\*.*" & >> >> > chr(34) >> >> > VarFilename=VarFilename & " /e /y /c /h /d >> >> > /EXCLUDE:C:\Users\kgrabske\Documents\BackupExclusions.txt" >> >> > >> >> > objShell.run VarFilename >> >> > >> >> > There isn't much to it, and I can't figure out why special >> >> > permissions >> >> > would >> >> > be required. I am already running the task using my login, and I am >> >> > an >> >> > administrator. >> >> > >> >> > Do you have any other thoughts? I may see if Macro Scheduler will >> >> > work. >> >> > I >> >> > used to use that a lot, but I moved away from it in favor of XP's >> >> > scheduled >> >> > tasks, which see to work much better than Vista's. >> >> > >> >> > Thanks, >> >> > >> >> > Keith >> >> > >> >> > >> >> > "Mark L. Ferguson" wrote: >> >> > >> >> >> It's very likely that the script won't run because it's calling >> >> >> something >> >> >> that needs you to 'run as administrator'. There are several ways >> >> >> you >> >> >> might >> >> >> accomplish this, but I'm not sure which one would work from >> >> >> Scheduled >> >> >> Tasks. >> >> >> One direct method might be to enable the default admin, and 'runas' >> >> >> that >> >> >> user. >> >> >> Go to Start/all programs/accessories/run, and type: >> >> >> >> >> >> control userpasswords2 >> >> >> >> >> >> Advanced tab, Advanced button, Users folder, rightclick >> >> >> Administrator, >> >> >> Properties, uncheck checkbox for "Account is disabled" >> >> >> Restart Windows. >> >> >> >> >> >> There could be other methods, but 'runas /user:Administrator ...' >> >> >> would >> >> >> be >> >> >> tested this way and you could look for other ways to accomplish >> >> >> this. >> >> >> -- >> >> >> Was this helpful? Then click the Ratings button. Voting helps the >> >> >> web >> >> >> interface. >> >> >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer >> >> >> Mark L. Ferguson >> >> >> .. >> >> >> >> >> >> "Keith" <Keith@xxxxxx> wrote in message >> >> >> news:747F1A15-4206-466E-9679-AA6060305894@xxxxxx >> >> >> > Mark, >> >> >> > >> >> >> > Thanks for the response. I tried creating a script which calls >> >> >> > my >> >> >> > script >> >> >> > as >> >> >> > you suggested, and then created a scheduled task to run that new >> >> >> > script, >> >> >> > but >> >> >> > I got the same result. Do you have any other suggestions? >> >> >> > >> >> >> > Thanks, >> >> >> > >> >> >> > Keith >> >> >> > >> >> >> > >> >> >> > "Mark L. Ferguson" wrote: >> >> >> > >> >> >> >> Create a script or bat file that runs the command: >> >> >> >> runas /user:<yourUserName> "cscript \"yourScript.VBS\" " >> >> >> >> >> >> >> >> -- >> >> >> >> Was this helpful? Then click the Ratings button. Voting helps >> >> >> >> the >> >> >> >> web >> >> >> >> interface. >> >> >> >> http://www.microsoft.com/wn3/locales...eAPostAsAnswer >> >> >> >> Mark L. Ferguson >> >> >> >> . >> >> >> >> >> >> >> >> "Keith" <Keith@xxxxxx> wrote in message >> >> >> >> news:6C1064A5-5A80-4970-A1DB-58C0A05A8415@xxxxxx >> >> >> >> > I have a vbs script that I use to copy files from my local >> >> >> >> > drive >> >> >> >> > to >> >> >> >> > a >> >> >> >> > network >> >> >> >> > drive as a backup. The script works fine on its own (by >> >> >> >> > double-clicking >> >> >> >> > it >> >> >> >> > or by running it from the command prompt). I created a >> >> >> >> > scheduled >> >> >> >> > task >> >> >> >> > to >> >> >> >> > have it run automatically, but it doesn't seem to work. It >> >> >> >> > says >> >> >> >> > that >> >> >> >> > it >> >> >> >> > completed successfully, but it didn't really do anything. >> >> >> >> > Even >> >> >> >> > if I >> >> >> >> > select >> >> >> >> > it in the Task Scheduler and then click "Run" in the Actions >> >> >> >> > pane, >> >> >> >> > it >> >> >> >> > says >> >> >> >> > it's status is "Running", but nothing is happening. What am I >> >> >> >> > doing >> >> >> >> > wrong? >> >> >> >> > >> >> >> >> > Thanks, >> >> >> >> > >> >> >> >> > Keith >> >> >> >> >> >> >> >> >> |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Task Scheduler Problem | Vista General | |||
| Task Scheduler Problem | General Discussion | |||
| Task scheduler problem | Vista General | |||
| Task scheduler problem : task do not close | Vista General | |||
| Task Scheduler Problem | Vista General | |||