Forum Discussion
Thank you for creating this topic! bschwass
anupamchampati , BenoitB, Reshail tristaanogre Any suggestions?π
- anupamchampati5 years agoFrequent Contributor
Just remove the " " from the dir, it is been treated as String because of that.
Just pass the dir as Para.
function test()
{
WshShell.Exec(dir)
}- bschwass5 years agoOccasional Contributor
I believe treating it as a string is the point? WshShell.Exec is meant to execute a string as a command I believe. Removing the quotes give the error that dir is not defined. Defining dir as a variable string results in the original error.
- anupamchampati5 years agoFrequent Contributor
I thought you are passing some command from dir as para
Microsoft have provided article to run dir as WshShell commandTry with this and check whether you need this one
function test()
{
WshShell.Run("%comspec% /k dir",1,true)
}
https://devblogs.microsoft.com/scripting/how-can-i-call-the-dir-command/