Winsat command not recognized in cmd.exe

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
bnc1
Pro Scripter
Posts: 127
Joined: Sun Jul 31, 2005 5:10 pm

Winsat command not recognized in cmd.exe

Post by bnc1 » Thu May 28, 2009 1:28 pm

This nice mini bench mark command works via a command prompt :

winsat disk -seq -read -drive c

but when I try to invoke it using this MS 11.1.10 script :

Let>RP_WAIT=1
Let>RP_ADMIN=1
run>"cmd.exe" /k winsat disk -seq -read -drive c
exit>0

I get a command prompt error message, "winsat is not recognized as an internal or external command" ??

Winsat is located in c:\windows\system32. At first I thought I had to change the current directory , but the current directory seems to be irrelevant. Winsat always works when I start cmd.exe manually, but never works when I try to invokde it with a MS script ??

Dazed and confused :shock:

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu May 28, 2009 2:26 pm

I don't have winsat.exe to test it. Is this Vista?

What happens if you run your script without the "winsat disk -seq -read -drive c" portion in the Run> line:
Let>RP_WAIT=1
Let>RP_ADMIN=1
run>"cmd.exe" /k
exit>0

Then type "winsat disk -seq -read -drive c" into the DOS window? If it fails I'm guessing you're not getting proper permissions.

bnc1
Pro Scripter
Posts: 127
Joined: Sun Jul 31, 2005 5:10 pm

Post by bnc1 » Thu May 28, 2009 2:46 pm

Yes, I am running Vista SP1 x64
Yes if I manually enter the winsat command after starting the command prompt via a MS script, I get the same error message :

"winsat is not recognized as an internal or external command"

An interesting clue ..if I start the command prompt manually and change the active directory to c:\windows\system32 and enter dir winsat*

01/20/2008 10:46 PM 3,893,760 WinSAT.exe
01/20/2008 10:46 PM 444,928 WinSATAPI.dll
2 File(s) 4,338,688 bytes
0 Dir(s) 80,557,494,272 bytes free


Now, if start the command prompt from a MS script and again enter dir winsat*

Volume in drive C is Vista
Volume Serial Number is 98B9-B2B8

Directory of c:\Windows\System32

01/20/2008 10:47 PM 383,488 WinSATAPI.dll
1 File(s) 383,488 bytes
0 Dir(s) 80,557,371,392 bytes free


Notice that winsat.exe is not listed !?

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Are the files hidden?

Post by gdyvig » Thu May 28, 2009 4:01 pm

Are the files hidden?

See unhiding them reveals them.

http://windowshelp.microsoft.com/Window ... f1033.mspx

Gale

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu May 28, 2009 4:08 pm

Funny that you can manually start a DOS prompt and it works. That would indicate that YOU have permission.

What happens if you leave out the Let>RP_ADMIN=1 line?

If you start a command prompt from MS, do you see the program if you type:
dir winsat* /a-d

That line excludes display of directories and should display all files regardless of their attributes.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu May 28, 2009 4:15 pm

Weird. Not sure why this is. But here's one way to get round it. Open Windows Explorer and go to C:\Windows\System32. Copy WinSAT.exe to your Documents folder. Then you can run the following macro:

Run>%USERDOCUMENTS_DIR%\WinSat.exe disk -seq -read -drive c
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Thu May 28, 2009 4:18 pm

Try including the path, in XP winsat installs in a different dir so this works:

Code: Select all

Run>cmd /k "c:\program files\microsoft windows vista upgrade advisor\winsat" disk -seq -read -drive c

bnc1
Pro Scripter
Posts: 127
Joined: Sun Jul 31, 2005 5:10 pm

Post by bnc1 » Thu May 28, 2009 4:47 pm

Marcus's suggestion worked. Thanks :D

The file was not hidden, RP_ADMIN=0 didnt change anything, and direct execution with the correct path didnt work either :o

Very strange indeed. Thanks for all the suggestions, now back to scripting and benchmarking !

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts