Hello I want to create a VB script to do the following. (I have looked at some many scripts)

Create a directory under windows

           \windows\Sun\Java\Deployment

then place a file into that directory 

I have the file in Dependencies (so it will be placed in Kbots)


Thank you

1 Comment   [ + ] Show Comment

Comments

  • I'm not sure what you want...
    Anything in this direction?

    Set oWsh = CreateObject("WScript.Shell")

    sRoot = oWsh.ExpandEnvironmentStrings("%Systemroot%")

    oWsh.Run "CMD /C MD " & sRoot & "\Sun\Java\Deployment",0,True
    oWsh.Run "CMD /C COPY C:\Windows\win.ini C:\Windows\Sun\Java\Deployment",0,True
Please log in to comment

Community Chosen Answer

2
Why don't you just use the File Sync under Distribution. It can create the folder and also copy the file down to that folder. 

http://www.itninja.com/blog/view/k1000-file-synchronization-tips-tricks-and-things-i-have-learned

The admin guide should also show you have to use it as well. No need to write a script if you just trying to copy something down to a machine. 
Answered 12/03/2015 by: nshah
Red Belt

Please log in to comment

Answers

0
I'm not sure what you want...
Anything in this direction?

Set oWsh = CreateObject("WScript.Shell")

sRoot = oWsh.ExpandEnvironmentStrings("%Systemroot%")

oWsh.Run "CMD /C MD " & sRoot & "\Sun\Java\Deployment",0,True
oWsh.Run "CMD /C COPY C:\Windows\win.ini C:\Windows\Sun\Java\Deployment",0,True
Answered 12/03/2015 by: kitco
White Belt

Please log in to comment
0

Stop wasting time with VB when a good old DOS command will do it in a single line:

xcopy deployment.properties c:\windows\Sun\Java\Deployment


Answered 12/04/2015 by: vjaneczko
Seventh Degree Black Belt

Please log in to comment
0
Place file into directory? xcopy deployment. properties c:\windows\Sun\Java\Deployment. I also recommend using the File Sync under Distribution.
Answered 12/23/2015 by: AaronDonald
White Belt

Please log in to comment
Answer this question or Comment on this question for clarity