2

I am running Vista Home Premium. I tried to write a script to do some simple automation.... it does not work!

even the most simple script like:

@echo ON
dir .

does not get executed and only an empty CMD shell pops open when started from explorer. From the cmd windows there is no problem.

This is really weird and I have never seen this before (but wrote many CMD scripts before)

ftype cmdfile and batfile are unchanged from "%1" %*

virusscan done - no problems

Is there a policy setting that might have changed? Any ideas?

5 Answers 5

0

Right click on script, click "Run As Administrator"

3
  • i am already logged in as Administrator. the cmd window that opens has Administrator rights
    – jamesvista
    Nov 18, 2009 at 20:38
  • Are you sure about that? blogsdna.com/2168/…
    – Marcin
    Nov 18, 2009 at 22:17
  • it says so in the title ;)
    – jamesvista
    Nov 20, 2009 at 10:35
0

Are you sure it's not executing too quickly?

Add a pause after the end and try again.

1
  • the output is different from my reference in the virtual machine. I try to find out here what could be broken in this VISTA installation.
    – jamesvista
    Nov 18, 2009 at 20:42
0

Lateral thinking, try PowerShell? Especially the ISE (Integrated Scripting Engine) GUI.

You can even start with built-in commands then work your way up to the PowerShell cmdlets. My view this is 'the way to go'.

2
  • 1
    Q:"My car's not working!" A:"Buy a jet!" - but +1 because PS is something everyone should use anyway.
    – Phoshi
    Nov 18, 2009 at 18:57
  • 1
    I know there are workarounds but I think here is something really wrong. E.g. I can run the script from within CMD window but not from explorer directly like I did so many times before.
    – jamesvista
    Nov 18, 2009 at 20:41
0

Originally, Microsoft intended to incorporate a new command shell in Vista but then decided to make the new shell a stand-alone application. The new application is called Powershell http://technet.microsoft.com/en-us/scriptcenter/dd742419

Thus, the old command interpreter cmd.exe has been continued although in a slightly newer version. (The Vista version is 6.0 whereas the XP version is 5.1.) Several commands are now in the standard list that were formerly available only in Support Tools or the Server 2003 Tools. There are also some new commands and they are indicated with an asterisk in the list below. Note that some commands may require administrator privileges.

http://technet.microsoft.com/en-us/library/bb490890.asp

-1

Sounds like your environment variables are corrupt ..

Open up a command prompt and type

echo %path%

And see what comes up then .. If the system32 folder isn't in there; then you might want to put it in there :)

1
  • Both dir and echo are shell-builtins and don't need PATH.
    – Joey
    Nov 16, 2010 at 1:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy