gzip batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
geronimo1
Posts: 15
Joined: 15 Apr 2019 11:31
Location: france
Contact:

Re: gzip batch

#16 Post by geronimo1 » 19 Apr 2019 12:42

Code: Select all

Le volume dans le lecteur D n'a pas de nom.
 Le num‚ro de s‚rie du volume est AED5-0530

 R‚pertoire de D:\Documents\directory

19/04/2019  20:38                 0 .gz
19/04/2019  08:40               207 gz.bat
16/04/2019  19:30            10˙167 index.html
               3 fichier(s)           10˙374 octets
               0 R‚p(s)  383˙203˙651˙584 octets libres
--------------------------------------
 Le volume dans le lecteur D n'a pas de nom.
 Le num‚ro de s‚rie du volume est AED5-0530

 R‚pertoire de D:\Documents\directory

19/04/2019  20:40                 0 .gz
16/04/2019  19:30            10˙167 foobar.js
19/04/2019  08:40               207 gz.bat
              3 fichier(s)           10˙374 octets
               0 R‚p(s)  383˙202˙799˙616 octets libres
-------------------------------
 Le volume dans le lecteur D n'a pas de nom.
 Le num‚ro de s‚rie du volume est AED5-0530

 R‚pertoire de D:\Documents\directory

19/04/2019  20:42                 0 .gz
16/04/2019  19:30            10˙167 file.css
19/04/2019  08:40               207 gz.bat
              3 fichier(s)           10˙374 octets
               0 R‚p(s)  383˙202˙521˙088 octets libres

Squashman
Expert
Posts: 4107
Joined: 23 Dec 2011 13:59

Re: gzip batch

#17 Post by Squashman » 19 Apr 2019 15:12

In both of your previous two examples I do not see you executing the batch file like I did in my example to show you that it works.

geronimo1
Posts: 15
Joined: 15 Apr 2019 11:31
Location: france
Contact:

Re: gzip batch

#18 Post by geronimo1 » 20 Apr 2019 00:53

C:\BatchFiles\GZIP>dir
Le volume dans le lecteur C n’a pas de nom.
Le numéro de série du volume est AEE0-7696

Répertoire de C:\BatchFiles\GZIP

20/04/2019 08:49 <DIR> .
20/04/2019 08:49 <DIR> ..
20/04/2019 08:49 0 .gz
12/04/2019 20:14 11 084 file.css
19/04/2019 08:40 207 gz.bat
3 fichier(s) 11 291 octets
2 Rép(s) 96 094 429 184 octets libres

---------------------------------------------
C:\BatchFiles\GZIP>dir
Le volume dans le lecteur C n’a pas de nom.
Le numéro de série du volume est AEE0-7696

Répertoire de C:\BatchFiles\GZIP

20/04/2019 08:51 <DIR> .
20/04/2019 08:51 <DIR> ..
20/04/2019 08:51 0 .gz
19/04/2019 08:40 207 gz.bat
16/04/2019 19:30 10 167 index.html
3 fichier(s) 10 374 octets
2 Rép(s) 96 094 461 952 octets libres
-----------------------------
C:\BatchFiles\GZIP>dir
Le volume dans le lecteur C n’a pas de nom.
Le numéro de série du volume est AEE0-7696

Répertoire de C:\BatchFiles\GZIP

20/04/2019 08:52 <DIR> .
20/04/2019 08:52 <DIR> ..
20/04/2019 08:52 0 .gz
13/04/2019 09:11 2 458 foobar.js
19/04/2019 08:40 207 gz.bat
3 fichier(s) 2 665 octets
2 Rép(s) 96 094 457 856 octets libres

aGerman
Expert
Posts: 3673
Joined: 22 Jan 2010 18:01
Location: Germany

Re: gzip batch

#19 Post by aGerman » 20 Apr 2019 07:34

As Squashman already said - posting the output of DIR several times doesn't help without seeing the Batch code you used.

Steffen

Squashman
Expert
Posts: 4107
Joined: 23 Dec 2011 13:59

Re: gzip batch

#20 Post by Squashman » 20 Apr 2019 09:07

What is the point of showing the directory contents three times? That is not what I did in my example to show you that the batch file does in fact work correct. I did a directory listing. Then executed the batch file three times. One for each file. Then I did a directory listing again.

geronimo1
Posts: 15
Joined: 15 Apr 2019 11:31
Location: france
Contact:

Re: gzip batch

#21 Post by geronimo1 » 22 Apr 2019 06:47

i dont understand what yu want

with cmd if i execute this command

C:\>C:\BatchFiles\GZIP>gz.bat index.html
Le client ne dispose pas d’un privilège nécessaire.

C:\>C:\BatchFiles\GZIP>gz.bat file.css
Le client ne dispose pas d’un privilège nécessaire.

C:\>C:\BatchFiles\GZIP>gz.bat foobar.js
Le client ne dispose pas d’un privilège nécessaire.

C:\BatchFiles\GZIP>dir
Le volume dans le lecteur C s’appelle Acer
Le numéro de série du volume est CE63-7C9E

Répertoire de C:\BatchFiles\GZIP

22/04/2019 14:42 <DIR> .
22/04/2019 14:42 <DIR> ..
12/04/2019 20:14 11 084 file.css
13/04/2019 09:11 2 458 foobar.js
22/04/2019 14:35 207 gz.bat
19/04/2019 10:36 10 903 index.html
4 fichier(s) 24 652 octets
2 Rép(s) 63 688 568 832 octets libres

aGerman
Expert
Posts: 3673
Joined: 22 Jan 2010 18:01
Location: Germany

Re: gzip batch

#22 Post by aGerman » 22 Apr 2019 07:14

- What is the code in gz.bat?
- Why don't you have the required permissions? Is the GZIP folder set read-only? Or do you have the files still opened in an editor or IDE?

Steffen

geronimo1
Posts: 15
Joined: 15 Apr 2019 11:31
Location: france
Contact:

Re: gzip batch

#23 Post by geronimo1 » 22 Apr 2019 12:49

your batch
------
@echo off

setlocal

set "ext_o=.gz"

if /i "%~x1" == ".css" set "ext_o=.csz"
if /i "%~x1" == ".js" set "ext_o=.jgz"
if /i "%~x1" == ".html" set "ext_o=.htz"

gzip -c "%~dpnx1" > "%~dpn1%ext_o%"
-------
non open in an editor

-----
on my computer at home

C:\>C:\BatchFiles\GZIP>gz.bat index.html
Accès refusé.

C:\>c:\Batchfiles\GZIP\gz.bat file.css
Accès refusé.
-------------------------
if on cmd i do:

Microsoft Windows [version 10.0.17134.706]
(c) 2018 Microsoft Corporation. Tous droits réservés.


C:\>gzip -k -r c:\batchfiles\gzip

all work perfectly

but

C:\>gzip -k -r -f c:\batchfiles\gzip
gzip: c:\batchfiles\gzip: Permission denied

C:\>gzip -c c:\batchfiles\gzip
gzip: c:\batchfiles\gzip: Permission denied


i cannot understand because there are all permission on the files even if the directories batchfiles and gzip stay in read only impossible to change this
https://appuals.com/how-to-fix-folder-k ... indows-10/
i have tried these solution but still the same on my both computers
its just the directories which stay read only, the file are not in read only
with or whithout antivirus the same
unable to uncheck read only on the directories

geronimo1
Posts: 15
Joined: 15 Apr 2019 11:31
Location: france
Contact:

Re: gzip batch

#24 Post by geronimo1 » 22 Apr 2019 13:41

after check uncheck modify back etc etc.... directories still in read only but now
on cmd

C:\>gzip -f -k -r c:\batchfiles\gzip\*
work perfectly

but

C:\>C:\batchfiles\GZIP\gz.bat file.css
Le client ne dispose pas d’un privilège nécessaire.

really i dont know how to solve

aGerman
Expert
Posts: 3673
Joined: 22 Jan 2010 18:01
Location: Germany

Re: gzip batch

#25 Post by aGerman » 22 Apr 2019 13:52

The prompt "C:\>" indicates that C:\ is the current working directory. Trying to write to the C: root folder will certainly give you an "access denied" error. Use the CD command to change the working directory to a folder where you have writing permissions.

Steffen

geronimo1
Posts: 15
Joined: 15 Apr 2019 11:31
Location: france
Contact:

Re: gzip batch

#26 Post by geronimo1 » 23 Apr 2019 02:00

thanks Stephen
in fact all my directories are in read only even if all the files inside can be modified
its the same on my both computers
i tried to close kaspersky but the same impossible to uncheck read only
i shall try to read on internet what is this bug with windows 10

aGerman
Expert
Posts: 3673
Joined: 22 Jan 2010 18:01
Location: Germany

Re: gzip batch

#27 Post by aGerman » 23 Apr 2019 04:37

There are folders that are protected by the User Account Control (UAC), such as C:, C:\Windows, C:\Program Files. This is for security reasons and you should not try to change this behavior.
Don't get confused with other folders. The folder properties are quite misleading. As long as you are able to create new files or to change existing files by hand, everything is okay.

Steffen

geronimo1
Posts: 15
Joined: 15 Apr 2019 11:31
Location: france
Contact:

Re: gzip batch

#28 Post by geronimo1 » 23 Apr 2019 08:06

so i dont know what is the problem

aGerman
Expert
Posts: 3673
Joined: 22 Jan 2010 18:01
Location: Germany

Re: gzip batch

#29 Post by aGerman » 23 Apr 2019 08:14

Neither do I. Yesterday I downloaded gzip to do some tests. Works flawlessly for me. Since I can't reproduce your problem, I really don't know how I could help you. Sorry.

Steffen

geronimo1
Posts: 15
Joined: 15 Apr 2019 11:31
Location: france
Contact:

Re: gzip batch

#30 Post by geronimo1 » 23 Apr 2019 23:57

thanks stephen
i know that its work for all
i shall continue to explore what is wrong on my computer

Post Reply