![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | right click option to run a scipt without closing the window when done? I tried adding the following as a custom right-click command (via folder options) but I keep getting access denied permission errors (with the file path and name in the error text) when trying to run it via a right click on a vbs file: %SystemRoot%\system32\cmd.exe /k C:\WINDOWS\System32\CScript.exe "%1" Which should resolve to something like this at runtime (which runs fine at the command prompt by the way): c:\windows\system32\cmd.exe /k C:\WINDOWS\System32\CScript.exe "C:\Documents and Settings\Steve\Desktop\example.vbs" The default "Open with command prompt" just runs the vbs and then exits, I want the window the remain open when done. The /k tells the command window to stay open when done (so you can read the output, etc). Q: Any ideas why this isn't working, or how to get the desired action? Tested using XP-Pro SP2. I can provide a screen cap of the dialog if you need the visual. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: right click option to run a scipt without closing the window when done? "Steve" <sdixon2006@xxxxxx> wrote in message news 8Nsk.117438$nD.12944@xxxxxxQuote: >I tried adding the following as a custom right-click command (via folder >options) but I keep getting access denied permission errors (with the file >path and name in the error text) when trying to run it via a right click on >a vbs file: > %SystemRoot%\system32\cmd.exe /k C:\WINDOWS\System32\CScript.exe "%1" > > Which should resolve to something like this at runtime (which runs fine at > the command prompt by the way): > c:\windows\system32\cmd.exe /k C:\WINDOWS\System32\CScript.exe > "C:\Documents and Settings\Steve\Desktop\example.vbs" > > The default "Open with command prompt" just runs the vbs and then exits, I > want the window the remain open when done. The /k tells the command > window to stay open when done (so you can read the output, etc). > > Q: Any ideas why this isn't working, or how to get the desired action? > > Tested using XP-Pro SP2. I can provide a screen cap of the dialog if you > need the visual. '%1' argument. The code below should create the item for you. It works on my comptuer & I am also using XP-Pro SP2. Set oWSH = CreateObject("WScript.Shell") sSendTo = oWSH.Environment("Process").Item("UserProfile") & "\SendTo\" With oWSH.CreateShortcut(sSendTo & "Run With CScript.lnk") .TargetPath = "%SystemRoot%\system32\cmd.exe" .Arguments = "/k %systemroot%\system32\cscript.exe //NoLogo" .WorkingDirectory = "%temp%" .Description = "Run VBScript with CScript & leave window open." .IconLocation = "%systemroot%\system32\cscript.exe, 0" .Save End With |
My System Specs![]() |
| | #3 (permalink) |
| | Re: right click option to run a scipt without closing the window when done? "Steve" <sdixon2006@xxxxxx> wrote in message news 8Nsk.117438$nD.12944@xxxxxxQuote: >I tried adding the following as a custom right-click command (via folder >options) but I keep getting access denied permission errors (with the file >path and name in the error text) when trying to run it via a right click on >a vbs file: > %SystemRoot%\system32\cmd.exe /k C:\WINDOWS\System32\CScript.exe "%1" > > Which should resolve to something like this at runtime (which runs fine at > the command prompt by the way): > c:\windows\system32\cmd.exe /k C:\WINDOWS\System32\CScript.exe > "C:\Documents and Settings\Steve\Desktop\example.vbs" > > The default "Open with command prompt" just runs the vbs and then exits, I > want the window the remain open when done. The /k tells the command > window to stay open when done (so you can read the output, etc). > > Q: Any ideas why this isn't working, or how to get the desired action? > > Tested using XP-Pro SP2. I can provide a screen cap of the dialog if you > need the visual. associate this with a batch script that runs the script as vbscript and then executes a PAUSE statement. /Al |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Single Click option | Tutorials | |||
| closing a window when done | .NET General | |||
| CMD window now closing | Vista General | |||
| closing wlm in tray w/r-click, then have to reboot to get back into wlm | Live Mail | |||
| Closing window | Vista General | |||