![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | VBScript works on XP but Vista I wrote a VBScript to launch cURL.exe to login to a server periodically via task scheduler. I have also encoded the script to vbe. The script runs well on XP Pro but not on Vista. I don't get any error messages and the log file supposedly produced by cURL is never created. Does anyone know why? /Why Tea |
My System Specs![]() |
| | #2 (permalink) |
| | Re: VBScript works on XP but Vista probably permissions. Can you show the source code for the script? "Why Tea" <ytlim1@xxxxxx> wrote in message news:d61137f1-b657-4566-b568-0087db616390@xxxxxx Quote: > I wrote a VBScript to launch cURL.exe to login to a > server periodically via task scheduler. I have also > encoded the script to vbe. The script runs well on > XP Pro but not on Vista. I don't get any error messages > and the log file supposedly produced by cURL is > never created. Does anyone know why? > > /Why Tea |
My System Specs![]() |
| | #3 (permalink) |
| | Re: VBScript works on XP but Vista "Why Tea" <ytlim1@xxxxxx> wrote in message news:d61137f1-b657-4566-b568-0087db616390@xxxxxx Quote: >I wrote a VBScript to launch cURL.exe to login to a > server periodically via task scheduler. I have also > encoded the script to vbe. The script runs well on > XP Pro but not on Vista. I don't get any error messages > and the log file supposedly produced by cURL is > never created. Does anyone know why? out temporarily on the Vista computer to see if the script is throwing any errors. |
My System Specs![]() |
| | #4 (permalink) |
| | Re: VBScript works on XP but Vista "Why Tea" <ytlim1@xxxxxx> wrote in message news:d61137f1-b657-4566-b568-0087db616390@xxxxxx Quote: >I wrote a VBScript to launch cURL.exe to login to a > server periodically via task scheduler. I have also > encoded the script to vbe. The script runs well on > XP Pro but not on Vista. I don't get any error messages > and the log file supposedly produced by cURL is > never created. Does anyone know why? > > /Why Tea are logged on as Administrator. This is one major difference between Vista and XP. You can test this by running the script using "Run as administrator". I launch the command prompt with elevated privileges, then run scripts there. I have a shortcut to cmd.exe on my desktop. I right click the shortcut and select "Run as administrator". Then in the command prompt I can run scripts that require elevated privileges. You can also right click any executable, including a *.vbs file, and select "Run as administrator". If the script runs this way, you know it is permissions. If this doesn't resolve the problem, we need to see code. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #5 (permalink) |
| | Re: VBScript works on XP but Vista On Aug 13, 6:16*am, "Richard Mueller [MVP]" <rlmueller- nos...@xxxxxx> wrote: Quote: > "Why Tea" <ytl...@xxxxxx> wrote in message > > news:d61137f1-b657-4566-b568-0087db616390@xxxxxx > Quote: > >I wrote a VBScript to launch cURL.exe to login to a > > server periodically via task scheduler. I have also > > encoded the script to vbe. The script runs well on > > XP Pro but not on Vista. I don't get any error messages > > and the log file supposedly produced by cURL is > > never created. Does anyone know why? Quote: > > /Why Tea > Anything requiring administrator privileges will fail in Vista, even if you > are logged on as Administrator. This is one major difference between Vista > and XP. You can test this by running the script using "Run as > administrator". I launch the command prompt with elevated privileges, then > run scripts there. I have a shortcut to cmd.exe on my desktop. I right click > the shortcut and select "Run as administrator". Then in the command prompt I > can run scripts that require elevated privileges. You can also right click > any executable, including a *.vbs file, and select "Run as administrator".. > If the script runs this way, you know it is permissions. > > If this doesn't resolve the problem, we need to see code. > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab -http://www.rlmueller.net > -- off. Is there a way to get it working without turning off UAC? |
My System Specs![]() |
| | #6 (permalink) |
| | Re: VBScript works on XP but Vista Try this in the beginning of your code: If WScript.Arguments.length = 0 Then Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "wscript.exe", """" & _ WScript.ScriptFullName & """" &_ " RunAsAdministrator", , "runas", 1 Else 'code here End If "Why Tea" <ytlim1@xxxxxx> wrote in message news:bc69c51f-2b8f-46f4-9f45-16565f81f051@xxxxxx Quote: > On Aug 13, 6:16 am, "Richard Mueller [MVP]" <rlmueller- > nos...@xxxxxx> wrote: Quote: >> "Why Tea" <ytl...@xxxxxx> wrote in message >> >> news:d61137f1-b657-4566-b568-0087db616390@xxxxxx >> Quote: >> >I wrote a VBScript to launch cURL.exe to login to a >> > server periodically via task scheduler. I have also >> > encoded the script to vbe. The script runs well on >> > XP Pro but not on Vista. I don't get any error messages >> > and the log file supposedly produced by cURL is >> > never created. Does anyone know why? Quote: >> > /Why Tea >> Anything requiring administrator privileges will fail in Vista, even if >> you >> are logged on as Administrator. This is one major difference between >> Vista >> and XP. You can test this by running the script using "Run as >> administrator". I launch the command prompt with elevated privileges, >> then >> run scripts there. I have a shortcut to cmd.exe on my desktop. I right >> click >> the shortcut and select "Run as administrator". Then in the command >> prompt I >> can run scripts that require elevated privileges. You can also right >> click >> any executable, including a *.vbs file, and select "Run as >> administrator". >> If the script runs this way, you know it is permissions. >> >> If this doesn't resolve the problem, we need to see code. >> >> -- >> Richard Mueller >> MVP Directory Services >> Hilltop Lab -http://www.rlmueller.net >> -- > The same script actually works on Vista with UAC turned > off. Is there a way to get it working without turning off UAC? |
My System Specs![]() |
| | #7 (permalink) |
| | Re: VBScript works on XP but Vista Thanks Paulm. Does the code only work on scripts not using command line arguments? My script does need arguments to run. This is the actual sequence: main.vbe -> helper.vbe <userid> <passwd> (helper.vbe actually launches cURL.exe and cURL will write a log file) /Why Tea On Aug 13, 10:22*pm, "PaulM" <N...@xxxxxx> wrote: Quote: > Try this in the beginning of your code: > > If WScript.Arguments.length = 0 Then > Set objShell = CreateObject("Shell.Application") > objShell.ShellExecute "wscript.exe", """" & _ > WScript.ScriptFullName & """" &_ > *" RunAsAdministrator", , "runas", 1 > Else > > 'code here > > End If > > "Why Tea" <ytl...@xxxxxx> wrote in message > > news:bc69c51f-2b8f-46f4-9f45-16565f81f051@xxxxxx > Quote: > > On Aug 13, 6:16 am, "Richard Mueller [MVP]" <rlmueller- > > nos...@xxxxxx> wrote: Quote: > >> "Why Tea" <ytl...@xxxxxx> wrote in message Quote: Quote: > >>news:d61137f1-b657-4566-b568-0087db616390@xxxxxx Quote: Quote: > >> >I wrote a VBScript to launch cURL.exe to login to a > >> > server periodically via task scheduler. I have also > >> > encoded the script to vbe. The script runs well on > >> > XP Pro but not on Vista. I don't get any error messages > >> > and the log file supposedly produced by cURL is > >> > never created. Does anyone know why? Quote: Quote: > >> > /Why Tea Quote: Quote: > >> Anything requiring administrator privileges will fail in Vista, even if > >> you > >> are logged on as Administrator. This is one major difference between > >> Vista > >> and XP. You can test this by running the script using "Run as > >> administrator". I launch the command prompt with elevated privileges, > >> then > >> run scripts there. I have a shortcut to cmd.exe on my desktop. I right > >> click > >> the shortcut and select "Run as administrator". Then in the command > >> prompt I > >> can run scripts that require elevated privileges. You can also right > >> click > >> any executable, including a *.vbs file, and select "Run as > >> administrator". > >> If the script runs this way, you know it is permissions. Quote: Quote: > >> If this doesn't resolve the problem, we need to see code. Quote: Quote: > >> -- > >> Richard Mueller > >> MVP Directory Services > >> Hilltop Lab -http://www.rlmueller.net > >> -- Quote: > > The same script actually works on Vista with UAC turned > > off. Is there a way to get it working without turning off UAC? |
My System Specs![]() |
| | #8 (permalink) |
| | Re: VBScript works on XP but Vista "Why Tea" <ytlim1@xxxxxx> wrote in message news:0453c87c-e24d-4a02-88f3-018b0cb2b1c8@xxxxxx Quote: > Thanks Paulm. Does the code only work on > scripts not using command line arguments? Quote: > My script does need arguments to run. > > This is the actual sequence: > > main.vbe -> helper.vbe <userid> <passwd> > (helper.vbe actually launches cURL.exe > and cURL will write a log file) helper.vbe: Quote: Quote: >> If WScript.Arguments.length < 3 Then >> Set objShell = CreateObject("Shell.Application") >> objShell.ShellExecute "wscript.exe", """" & _ dummy third parameter. (sorry, too late to come up with actual code for this - lazy or tired, you be the judge :-) /Al Quote: Quote: >> WScript.ScriptFullName & """" &_ >> " RunAsAdministrator", , "runas", 1 >> Else >> >> 'code here >> >> End If Quote: > /Why Tea > > > On Aug 13, 10:22 pm, "PaulM" <N...@xxxxxx> wrote: Quote: >> Try this in the beginning of your code: >> >> If WScript.Arguments.length = 0 Then >> Set objShell = CreateObject("Shell.Application") >> objShell.ShellExecute "wscript.exe", """" & _ >> WScript.ScriptFullName & """" &_ >> " RunAsAdministrator", , "runas", 1 >> Else >> >> 'code here >> >> End If >> >> "Why Tea" <ytl...@xxxxxx> wrote in message >> >> news:bc69c51f-2b8f-46f4-9f45-16565f81f051@xxxxxx >> Quote: >> > On Aug 13, 6:16 am, "Richard Mueller [MVP]" <rlmueller- >> > nos...@xxxxxx> wrote: >> >> "Why Tea" <ytl...@xxxxxx> wrote in message Quote: >> >>news:d61137f1-b657-4566-b568-0087db616390@xxxxxx Quote: >> >> >I wrote a VBScript to launch cURL.exe to login to a >> >> > server periodically via task scheduler. I have also >> >> > encoded the script to vbe. The script runs well on >> >> > XP Pro but not on Vista. I don't get any error messages >> >> > and the log file supposedly produced by cURL is >> >> > never created. Does anyone know why? Quote: >> >> > /Why Tea Quote: >> >> Anything requiring administrator privileges will fail in Vista, even >> >> if >> >> you >> >> are logged on as Administrator. This is one major difference between >> >> Vista >> >> and XP. You can test this by running the script using "Run as >> >> administrator". I launch the command prompt with elevated privileges, >> >> then >> >> run scripts there. I have a shortcut to cmd.exe on my desktop. I right >> >> click >> >> the shortcut and select "Run as administrator". Then in the command >> >> prompt I >> >> can run scripts that require elevated privileges. You can also right >> >> click >> >> any executable, including a *.vbs file, and select "Run as >> >> administrator". >> >> If the script runs this way, you know it is permissions. Quote: >> >> If this doesn't resolve the problem, we need to see code. Quote: >> >> -- >> >> Richard Mueller >> >> MVP Directory Services >> >> Hilltop Lab -http://www.rlmueller.net >> >> -- Quote: >> > The same script actually works on Vista with UAC turned >> > off. Is there a way to get it working without turning off UAC? |
My System Specs![]() |
| | #9 (permalink) |
| | Re: VBScript works on XP but Vista On Aug 14, 12:44*am, "Al Dunbar" <aland...@xxxxxx> wrote: Quote: > "Why Tea" <ytl...@xxxxxx> wrote in message > > news:0453c87c-e24d-4a02-88f3-018b0cb2b1c8@xxxxxx > Quote: > > Thanks Paulm. Does the code only work on > > scripts not using command line arguments? > It would seem so, but... > Quote: > > My script does need arguments to run. Quote: > > This is the actual sequence: Quote: > > main.vbe -> helper.vbe <userid> <passwd> > > (helper.vbe actually launches cURL.exe > > and cURL will write a log file) > change Paul's suggestion to something along these lines to be added to > helper.vbe: > Quote: Quote: > >> If WScript.Arguments.length < 3 Then > >> Set objShell = CreateObject("Shell.Application") > >> objShell.ShellExecute "wscript.exe", """" & _ > In above, pass 3 parameters: the first two supplied to helper.vbe plus a > dummy third parameter. (sorry, too late to come up with actual code for > this - lazy or tired, you be the judge :-) > > /Al > Quote: Quote: > >> WScript.ScriptFullName & """" &_ > >> *" RunAsAdministrator", , "runas", 1 > >> Else Quote: Quote: > >> 'code here Quote: Quote: > >> End If Quote: > > On Aug 13, 10:22 pm, "PaulM" <N...@xxxxxx> wrote: Quote: > >> Try this in the beginning of your code: Quote: Quote: > >> If WScript.Arguments.length = 0 Then > >> Set objShell = CreateObject("Shell.Application") > >> objShell.ShellExecute "wscript.exe", """" & _ > >> WScript.ScriptFullName & """" &_ > >> *" RunAsAdministrator", , "runas", 1 > >> Else Quote: Quote: > >> 'code here Quote: Quote: > >> End If Quote: Quote: > >> "Why Tea" <ytl...@xxxxxx> wrote in message Quote: Quote: > >>news:bc69c51f-2b8f-46f4-9f45-16565f81f051@xxxxxx Quote: Quote: > >> > On Aug 13, 6:16 am, "Richard Mueller [MVP]" <rlmueller- > >> > nos...@xxxxxx> wrote: > >> >> "Why Tea" <ytl...@xxxxxx> wrote in message Quote: Quote: > >> >>news:d61137f1-b657-4566-b568-0087db616390@xxxxxx Quote: Quote: > >> >> >I wrote a VBScript to launch cURL.exe to login to a > >> >> > server periodically via task scheduler. I have also > >> >> > encoded the script to vbe. The script runs well on > >> >> > XP Pro but not on Vista. I don't get any error messages > >> >> > and the log file supposedly produced by cURL is > >> >> > never created. Does anyone know why? Quote: Quote: > >> >> > /Why Tea Quote: Quote: > >> >> Anything requiring administrator privileges will fail in Vista, even > >> >> if > >> >> you > >> >> are logged on as Administrator. This is one major difference between > >> >> Vista > >> >> and XP. You can test this by running the script using "Run as > >> >> administrator". I launch the command prompt with elevated privileges, > >> >> then > >> >> run scripts there. I have a shortcut to cmd.exe on my desktop. I right > >> >> click > >> >> the shortcut and select "Run as administrator". Then in the command > >> >> prompt I > >> >> can run scripts that require elevated privileges. You can also right > >> >> click > >> >> any executable, including a *.vbs file, and select "Run as > >> >> administrator". > >> >> If the script runs this way, you know it is permissions. Quote: Quote: > >> >> If this doesn't resolve the problem, we need to see code. Quote: Quote: > >> >> -- > >> >> Richard Mueller > >> >> MVP Directory Services > >> >> Hilltop Lab -http://www.rlmueller.net > >> >> -- Quote: Quote: > >> > The same script actually works on Vista with UAC turned > >> > off. Is there a way to get it working without turning off UAC? Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "wscript.exe", "" & Chr(34) & _ WScript.ScriptFullName & Chr(34), "", "runas", 1 This will prompt for the UAC permission to run. Notice the extra double quotes, before the runas, this is necessary as it is a bug in the runas. |
My System Specs![]() |
| | #10 (permalink) |
| | Re: VBScript works on XP but Vista On Aug 13, 10:22*pm, "PaulM" <N...@xxxxxx> wrote: Quote: > Try this in the beginning of your code: > > If WScript.Arguments.length = 0 Then > Set objShell = CreateObject("Shell.Application") > objShell.ShellExecute "wscript.exe", """" & _ > WScript.ScriptFullName & """" &_ > *" RunAsAdministrator", , "runas", 1 > Else > > 'code here > > End If > > "Why Tea" <ytl...@xxxxxx> wrote in message > > news:bc69c51f-2b8f-46f4-9f45-16565f81f051@xxxxxx > Quote: > > On Aug 13, 6:16 am, "Richard Mueller [MVP]" <rlmueller- > > nos...@xxxxxx> wrote: Quote: > >> "Why Tea" <ytl...@xxxxxx> wrote in message Quote: Quote: > >>news:d61137f1-b657-4566-b568-0087db616390@xxxxxx Quote: Quote: > >> >I wrote a VBScript to launch cURL.exe to login to a > >> > server periodically via task scheduler. I have also > >> > encoded the script to vbe. The script runs well on > >> > XP Pro but not on Vista. I don't get any error messages > >> > and the log file supposedly produced by cURL is > >> > never created. Does anyone know why? Quote: Quote: > >> > /Why Tea Quote: Quote: > >> Anything requiring administrator privileges will fail in Vista, even if > >> you > >> are logged on as Administrator. This is one major difference between > >> Vista > >> and XP. You can test this by running the script using "Run as > >> administrator". I launch the command prompt with elevated privileges, > >> then > >> run scripts there. I have a shortcut to cmd.exe on my desktop. I right > >> click > >> the shortcut and select "Run as administrator". Then in the command > >> prompt I > >> can run scripts that require elevated privileges. You can also right > >> click > >> any executable, including a *.vbs file, and select "Run as > >> administrator". > >> If the script runs this way, you know it is permissions. Quote: Quote: > >> If this doesn't resolve the problem, we need to see code. Quote: Quote: > >> -- > >> Richard Mueller > >> MVP Directory Services > >> Hilltop Lab -http://www.rlmueller.net > >> -- Quote: > > The same script actually works on Vista with UAC turned > > off. Is there a way to get it working without turning off UAC? suggestion. Thanks. One more question, when the same script is run by the Task Scheduler, Vista always pops up and asks for permission. Is there a way around it? /Why Tea |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Re: VBscript works normally on Windows XP/Win2003 but not on Win Vista -> "Invalid class" error | VB Script | |||
| How to do No hang up VBScript (nohup for VBScript) | VB Script | |||
| How to read Works 4 .wps files in Vista [Works 9?] | Vista General | |||
| Works 8.5 in Vista: "Microsoft Works has stopped working" | Vista General | |||
| Vista and VBScript | Vista General | |||