Run command prompt command via VBScript

I have a command which gives only read permissions to the user on D drive .. When I run the command from cmd it runs just fine but when I try running it by integrating with VBScript it just doesn't work... I tried everything I could it just doesn't work.... any help please!!!!!

this is the command I want to run via vbscript

echo y|cacls.exe D:\ /G user:R

when I run the script it shows "file not found " error.

Thanks in advance!!

August 28th, 2013 1:38am

cmd /c echo y|cacls.exe D:\ /G user:R

Free Windows Admin Tool Kit Click here and download it now
August 28th, 2013 1:47am

thank you so much it worked :):)
August 28th, 2013 2:07am

Of course - I am a student of the Hidden Arts.
Free Windows Admin Tool Kit Click here and download it now
August 28th, 2013 2:09am

Hi i have one more query .. I have a group Domain Users to which i want to set permissions. I use below script:

Dim temp : temp ="Domain Users"

objShell.Run("cmd /c echo y|cacls.exe C:\ /G "&temp&":F")

However it doesnt work. I tried running the command through admin account but doesnt work and when i run the command in cmd it just works fine.. Pls help

thanks in advance :)

September 3rd, 2013 2:27am

Please post you whole script and the exact error.
Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2013 4:31am

There is no error and the script is this much only it just locks c drive for domain users. I tried with icacls and it worked.But i had to add the whole users group in command and why this happened? The command you gave works fine with D drive but doesnt work for C. How it that
September 3rd, 2013 5:03am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics