Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command line in IIS using Server.CreateObject("WScript.Shell") (in asp classic) not working #1143

Open
courtens opened this issue Jul 4, 2023 · 1 comment

Comments

@courtens
Copy link

courtens commented Jul 4, 2023

I am not sure what I am doing wrong...

function make_minify_version(file_name,input_dir,output_dir)
	dim command, shell
	command = "%comspec% /c html-minifier " & _
		" --input-dir """ & input_dir & """ " & _
		" --output-dir """ & output_dir & """ " &_
		" -o """ & file_name & """"
	Set shell = Server.CreateObject("WScript.Shell")
	shell.exec command
	set shell = nothing
end function

which should executes:

html-minifier --input-dir "D:\www\static_html\" --output-dir "D:\www\static_html\min\" -o test.html 

Running the above in cmd I am getting the error:

You need to specify where to write the output files with the option --output-dir

Running

whitespace -V

I get

4.0.0

I would really like to save the file as test.html.min in the same folder instead of having it in a sub folder with the same name.
Is that possible?

@courtens
Copy link
Author

courtens commented Jul 4, 2023

I got it working

Minifier_command = "npm exec --no -- html-minifier " & _
	"""" & absoluteFileLocationAndName & """ " & _
	" -o """ & absoluteFileLocationAndName & ".min"" " & _
	" -c ""C:\Windows\System32\node_modules\html-minifier\html-cli-config-file.conf"""

the only problem I am having now is that I need to know when it is finished. How can a get a return?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant