Making a folder on Windows with Script Scripter
Making a folder on Windows with Script Scripter
Does anyone know how to make a folder via Scripter on Windows? I'm trying to Process.execute with the commands md and mkdir but I'm getting the following error: "Failed to run external process: mkdir".
Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Re: Making a folder on Windows with Script Scripter
Command: C:/Windows/System32/cmd.exe
Arguments: /c "mkdir d:\folder"
mkdir runs from within the command prompt, you can't call it directly.
/C Carries out the command specified by string and then terminates
Edit: I misread, thought you was using Execute Command. However via scripting it's the same, call mkdir via cmd.exe.
Edit2: This will do: Process.execute("c:/Windows/System32/cmd.exe /c \"mkdir d:\\folder\"")
Arguments: /c "mkdir d:\folder"
mkdir runs from within the command prompt, you can't call it directly.
/C Carries out the command specified by string and then terminates
Edit: I misread, thought you was using Execute Command. However via scripting it's the same, call mkdir via cmd.exe.
Edit2: This will do: Process.execute("c:/Windows/System32/cmd.exe /c \"mkdir d:\\folder\"")
Part of my playground:
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
Re: Making a folder on Windows with Script Scripter
Woah, thanks for that. I there any way of doing this for Mac environments so you can get CLI behavior identical to the normal terminal within Scripter?
Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Re: Making a folder on Windows with Script Scripter
Not sure, I'm more a Windows guy. Since my Switch is on Windows too I can't really test to figure it out.
Part of my playground:
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
Re: Making a folder on Windows with Script Scripter
Doh! Here's a better way using the Switch Directory class:
Code: Select all
if(!thatDir.exists){
thisDir.mkdir(that);
}
Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix